This interface contains all methods available in the instance returned by initApplePayButton.Watch Out!
The Apple Pay functionality is currently in a testing phase. It is only available for merchants in Chile 🇨🇱 and Peru 🇵🇪, and supports Visa and Mastercard cards.Please note that this functionality is subject to change without prior notice.
Hierarchy#
Methods#
onCancel#
This event is triggered when the Apple Pay token process is canceledParameters#
| Name | Type | Description |
|---|
callback | () => void | Function executed when the tokenization process is canceled. |
Returns#
Example#
The instance of cardApplePay must be previously initialized with initApplePayButton.onClick#
This event is triggered when the user clicks on the Apple Pay button.Parameters#
| Name | Type | Description |
|---|
callback | () => void | Function executed when the Apple Pay button is clicked. |
Returns#
Example#
The instance of cardApplePay must be previously initialized with initApplePayButton.requestApplePayToken#
Starts the Apple Pay payment flow and requests a Kushki card token.This token is already processed and ready to be used in Kushki’s API to perform a charge.This method requires that initApplePayButton has been successfully initialized and uses a valid ICardApplePay instance.
Parameters#
| Name | Type | Description |
|---|
options | ApplePayGetTokenOptions | Configuration options for the Apple Pay payment request. |
ApplePayGetTokenOptions fields:| Field | Type | Description |
|---|
countryCode | string | Merchant’s country (e.g., "BR", "CL", "CO", "CR", "EC", "SV", "GT", "HN", "MX", "NI", "PA", "PE"). |
currencyCode | string | Currency for the transaction (e.g., "USD", "COP", "CLP", "UF", "PEN", "MXN", "BRL", "CRC", "GTQ", "HNL", "NIO"). |
displayName | string | The merchant name displayed in the Apple Pay sheet. |
amount | number | Transaction amount. |
optionalApplePayFields | object (optional) | Additional Apple Pay configuration fields, following Apple’s official specification. These fields allow merchants to customize their checkout experience (e.g., required shipping methods, billing address, etc.). |
Returns#
Promise<AppleTokenResponse>
A promise that resolves with the tokenized payment response.Throws#
| Code | Description |
|---|
ERRORS.E025 | Apple Pay payments are not available. |
ERRORS.E026 | Apple Pay token process fails. |
ERRORS.E027 | Apple Pay token process canceled. |
Example 1 — Basic usage#
Example — Required billing and shipping data#