Skip to content

Instantly share code, notes, and snippets.

@jeffcarp
Created July 28, 2016 22:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jeffcarp/5879cebb61049baca52a79a0cd567b66 to your computer and use it in GitHub Desktop.
Save jeffcarp/5879cebb61049baca52a79a0cd567b66 to your computer and use it in GitHub Desktop.
var session
if (window.ApplePaySession) {
var merchantIdentifier = 'merchant.com.canine-clothing'
ApplePaySession.canMakePaymentsWithActiveCard(merchantIdentifier)
.then(function (canMakePayments) {
if (canMakePayments) {
showApplePayButtons()
}
});
}
var paymentRequest = {
currencyCode: 'USD',
countryCode: 'US',
total: {
label: 'Canine Clothing',
amount: '19.99'
},
supportedNetworks: ['amex', 'discover', 'masterCard', 'visa'],
merchantCapabilities: ['supports3DS'],
requiredShippingAddressFields: ['postalAddress']
};
$('.apple-pay-button').on('click', function () {
session = new ApplePaySession(1, paymentRequest)
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment