package
Wrapper for working with Apple Pay payments
npm install apple-payGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Estimated unpacked size across 1 packages.
10.1 kB
Includes dependencies.
Wrapper for working with Apple Pay payments
Simplifies interaction with native ApplePay API. Support:
supportsVersionsupportedNetworks version basedisPaymentAvailablenpm i -S apple-payNote: This project is compatible with node v14+
import ApplePay, { STATUS_SUCCESS, STATUS_FAILURE } from 'apple-pay';
if (ApplePay.isPaymentAvailable) {
const paymentRequest = {
total: {
label: 'Merchant name',
amount: '10.0'
},
countryCode: 'US',
currencyCode: 'USD',
supportedCountries: ['US'],
merchantCapabilities: ['supports3DS'],
supportedNetworks: ['amex', 'discover']
}
const session = new ApplePay({
onValidateMerchant,
onPaymentAuthorized,
paymentRequest
});