-
Notifications
You must be signed in to change notification settings - Fork 65
Open
Description
In my project, I have two payment methods - credit card and bank transfer. Bank transfer means postpay. User pays invoice after order complete. Current code works fine when I choose credit card as payment method. When I choose bank transfer then I cannot submit form due to submit handlers from vzero stop it.
I placed this JS
window.currentSpreeBraintreeVzeroIntegration = integration;Later in the code I add
$('input[name*=payment_method_id]').on('change', function() {
if( window.currentSpreeBraintreeVzeroIntegration ) {
// payment_method_id == 3 bank transfer
if( $(this).val() == 3 ) {
console.log('val='+$(this).val());
window.currentSpreeBraintreeVzeroIntegration.teardown();
}
}
});This JS call teardown() when user chooses bank transfer payment method. Now user can submit form.
Unfortunately I am not sure is this solution correct.
Metadata
Metadata
Assignees
Labels
No labels