Skip to content

Instantly share code, notes, and snippets.

@fred-stripe
Created April 24, 2017 18:24
Show Gist options
  • Save fred-stripe/9c4cf877ee8bda80d8db177196bb6a79 to your computer and use it in GitHub Desktop.
Save fred-stripe/9c4cf877ee8bda80d8db177196bb6a79 to your computer and use it in GitHub Desktop.
jiggery pokery for apple pay—inject a button from the console
Stripe.applePay.checkAvailability(console.log);
var btn = document.createElement("button");
btn.innerText = "Apple Pay Jiggery Pokery";
btn.onclick = function () {Stripe.applePay.buildSession({
countryCode: 'US',
currencyCode: 'USD',
total: {
label: 'Apple Pay Test',
amount: '10.00'
}
},
function(result, completion) {
completion(false);
}, function(error) {
console.log(error);
}).begin();}
document.body.appendChild(btn);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment