This event is used to know when the token process is canceled.
Instance of cardApplePay is previously initialized with initApplePayButton
cardApplePay.onCancel(() => {
console.log("Apple Pay token process canceled");
});
This event is used to know when the user clicks on the Apple Pay button.
Instance of cardApplePay is previously initialized with initApplePayButton
cardApplePay.onClick(() => {
console.log("Apple Pay button clicked");
});
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.
Configuration options for the Apple Pay payment request.
"BR", "CL", "CO", "CR", "EC", "SV", "GT", "HN", "MX", "NI", "PA", "PE")."USD", "COP", "CLP", "UF", "PEN", "MXN", "BRL", "CRC", "GTQ", "HNL", "NIO").Promise resolving to the tokenized payment response.
Basic Example usage:
try{
const response = await cardApplePay.requestApplePayToken(
{
countryCode: "EC",
currencyCode: "USD",
displayName: "My Store",
amount: 5000
});
console.log("Card token:", response.token);
} catch(error){
console.error("Error requesting token:", error);
}
Required billing and shipping data Example usage:
try{
const response = await cardApplePay.requestApplePayToken(
{
countryCode: "EC",
currencyCode: "USD",
displayName: "My Store",
amount: 5000,
optionalApplePayFields:{
requiredBillingContactFields: ["postalAddress"],
requiredShippingContactFields: ["postalAddress"],
}
});
console.log("Card token:", response.token);
console.log("Apple Wallet billing data:", response.billingContact);
console.log("Apple Wallet shipping data:", response.shippingContact);
} catch(error){
console.error("Error requesting token:", error);
}
Generated using TypeDoc
This interface contains all methods available in the instance returned by initApplePayButton.