Created
April 24, 2017 18:24
-
-
Save fred-stripe/9c4cf877ee8bda80d8db177196bb6a79 to your computer and use it in GitHub Desktop.
jiggery pokery for apple pay—inject a button from the console
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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