Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Callbacks in Xtech checkout
// Vars that needs to be set in order to work with pagseguro checkout process
var checkoutCallbacks = $.Callbacks();
var checkoutNoSubmit = false;
// This calls the callback from ex. pagseguro.'checkout');
// If the checkoutNoSubmit variable is set to false go and submit the form, otherwise prevent the form submit.
if (checkoutNoSubmit === false) {
// If the checkoutNoSubmit was set to false and pagseguro sets the creditCartToken input we will submit the form.
return true;
// If the checkoutNoSubmit is true we do not submit and wait for the pagseguro response in order to set the creditcard token.
return false;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment