Skip to content

Instantly share code, notes, and snippets.

@mootrichard
Last active January 3, 2018 18:39
Show Gist options
  • Save mootrichard/596f12165f22f853be3cf6247bc2b0b1 to your computer and use it in GitHub Desktop.
Save mootrichard/596f12165f22f853be3cf6247bc2b0b1 to your computer and use it in GitHub Desktop.
cardNonceResponseReceived: function(errors, nonce, cardData) {
if (errors) {
// Log errors from nonce generation to the Javascript console
console.log("Encountered errors:");
errors.forEach(function(error) {
console.log(" " + error.message);
});
return;
}
console.log(cardData);
console.log("nonce: %s", nonce);
// Assign the nonce value to the hidden form field
$("#card-nonce").val(nonce);
$("#square-payment-form").submit();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment