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
pin
The PIN of the gift card.
completion
The 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
nonce
The token passed for processing the payment transaction.
amount
The amount to purchase.
completion
The 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
cardNumber
The gift card number the user wants to top up.
nonce
The token passed for processing the payment transaction.
amount
The amount to purchase.
parameters
The
Parameters
to apply.completion
The 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
giftCard
The
GiftCard
to update.completion
The 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
completion
The 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
parameters
The
Parameters
to apply.completion
The 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
cardNumber
The gift card number to check.
parameters
The
Parameters
to apply.completion
The closure to be executed once the request has finished.