#
ApplePay
#
The ApplePay Payment Method.
Requests a payment nonce for a payment card stored in an Apple Pay digital wallet.
Methods
applePay.js
JS
JavaScript
// Create a request to pay 1.00 USD
const paymentRequest = payments.paymentRequest({
countryCode: 'US',
currencyCode: 'USD',
total: {
amount: '1.00',
label: 'Total',
}
});
// Get a new Apple Pay method
const applePay = await payments.applePay(paymentRequest);
const applePayButtonTarget = document.getElementById('applePay');
applePayButtonTarget.onclick = async () => {
//Start the Apple Pay flow and await the secure token result
const tokenResult = await applePay.tokenize();
// Pass the TokenResult to your server to complete the payment
}