Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2 bugs in squareWebPay interoperation; fixes #408 #410

Merged
merged 1 commit into from
Apr 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
42 changes: 21 additions & 21 deletions includes/modules/pages/checkout_one/jquery.checkout_one.js
Original file line number Diff line number Diff line change
Expand Up @@ -421,29 +421,29 @@ jQuery(document).ready(function() {
// If there is at least one payment method available, submit the form.
//
if (flagOnSubmit) {
setFormSubmitButton();
var formPassed = check_form();
zcLog2Console('Form checked, passed ('+formPassed+')');
zcLog2Console('Form checked, passed (' + formPassed + ')');

if (formPassed) {
// -----
// If we're submitting based on a "Confirm Order" button-click,
// activate the OPC overlay, disable that button and set the document's
// cursor to the 'wait' state.
//
if (submit_type === 'confirm') {
jQuery('*').css('cursor', 'wait');
jQuery('#checkoutPayment > .opc-overlay').addClass('active');
jQuery('#opc-order-confirm').attr('disabled', true);
}
jQuery('#confirm-the-order').attr('disabled', false);

// -----
// If the currently-selected payment method handles the submission of the
// payment-form, defer the submission to its handling.
//
if (paymentMethodHandlesSubmit == true) {
zcLog2Console('Deferring form submittal to the currently-selected payment method.');
} else {
if (paymentMethodHandlesSubmit == true) {
zcLog2Console('Deferring form submittal to the currently-selected payment method.');
} else {
if (formPassed) {
// -----
// If we're submitting based on a "Confirm Order" button-click,
// activate the OPC overlay, disable that button and set the document's
// cursor to the 'wait' state.
//
if (submit_type === 'confirm') {
jQuery('*').css('cursor', 'wait');
jQuery('#checkoutPayment > .opc-overlay').addClass('active');
jQuery('#opc-order-confirm').attr('disabled', true);
}
jQuery('#confirm-the-order').attr('disabled', false);
// -----
// If the currently-selected payment method handles the submission of the
// payment-form, defer the submission to its handling.
//
jQuery('form[name="checkout_payment"]').submit();
}
}
Expand Down