Created
December 14, 2019 02:51
-
-
Save staycreativedesign/45f8d55b3c199ce8c5b073076613b651 to your computer and use it in GitHub Desktop.
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
function stripetokenhandler(token) { | |
// insert the token id into the form so it gets submitted to the server | |
var form = document.getelementbyid('payment-form'); | |
var hiddeninput = document.createelement('input'); | |
hiddeninput.setattribute('type', 'hidden'); | |
hiddeninput.setattribute('name', 'stripetoken'); | |
hiddeninput.setattribute('value', token.id); | |
form.appendchild(hiddeninput); | |
// submit the form | |
form.submit(); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment