GiftCardsAPI
public enum GiftCardsAPI
Caseless enumeration with static methods to send Gift Cards Requests
-
Sends a request to link a gift card to the user.
Declaration
Swift
public static func add(cardNumber: String, with pin: String, completion: ResponseCompletion<Bool> = nil)Parameters
pinThe PIN of the gift card.
completionThe closure to be executed once the request has finished.
-
Sends a request to purchase a gift card.
Declaration
Swift
public static func purchaseGiftCard(nonce: String, with amount: Double, giftCardClass: String, completion: ResponseCompletion<GiftCard> = nil)Parameters
nonceThe token passed for processing the payment transaction.
amountThe amount to purchase.
completionThe closure to be executed once the request has finished.
-
Sends a request to top up a gift card.
Declaration
Swift
public static func topUp(cardNumber: String, nonce: String, with amount: Double, completion: ResponseCompletion<Bool> = nil)Parameters
cardNumberThe gift card number the user wants to top up.
nonceThe token passed for processing the payment transaction.
amountThe amount to purchase.
parametersThe
Parametersto apply.completionThe closure to be executed once the request has finished.
-
Sends a request to update gift card.
Declaration
Swift
public static func update(giftCard: GiftCard, completion: ResponseCompletion<Bool> = nil)Parameters
giftCardThe
GiftCardto update.completionThe closure to be executed once the request has finished.
-
Sends a request to get payment client token.
Declaration
Swift
public static func getPaymentClientToken(completion: ResponseCompletion<String> = nil)Parameters
completionThe closure to be executed once the request has finished.
-
Sends a request to get the list of gift cards of the user.
Declaration
Swift
public static func getGiftCards(with parameters: Parameters? = nil, completion: ResponseCompletion<[GiftCard]> = nil)Parameters
parametersThe
Parametersto apply.completionThe closure to be executed once the request has finished.
-
Sends a request to get transaction of gift card.
Declaration
Swift
public static func getTransactions(cardNumber: String, with parameters: Parameters? = nil, completion: ResponseCompletion<[GiftCard.Transaction]> = nil)Parameters
cardNumberThe gift card number to check.
parametersThe
Parametersto apply.completionThe closure to be executed once the request has finished.
View on GitHub
GiftCardsAPI Enumeration Reference