Skip to content
Snippets Groups Projects
Commit b0cc84e2 authored by mattwire's avatar mattwire Committed by mattwire
Browse files

Fix payment failed because 'requires payment method' showing as 'successful' on thankyou page

parent c91b442f
Branches
Tags
1 merge request!1526.6 to master
......@@ -24,7 +24,15 @@
confirm.handleCardConfirm();
}
}
else {
else if (paymentIntentProcessResponse.requires_payment_method) {
CRM.payment.debugging(confirm.scriptName, 'Payment failed - requires_payment_method');
confirm.swalFire({
title: '',
text: ts('The payment failed - please try a different payment method.'),
icon: 'error'
}, '', true);
}
else if (paymentIntentProcessResponse.succeeded) {
// All good, nothing more to do
CRM.payment.debugging(confirm.scriptName, 'success - payment captured');
confirm.swalFire({
......@@ -32,6 +40,14 @@
icon: 'success'
}, '', true);
}
else {
CRM.payment.debugging(confirm.scriptName, 'Payment Failed - unknown error');
confirm.swalFire({
title: '',
text: ts('The payment failed - unknown error.'),
icon: 'error'
}, '', true);
}
},
/**
......@@ -87,7 +103,6 @@
*/
handleCardConfirm: function() {
CRM.payment.debugging(confirm.scriptName, 'handle card confirm');
if (CRM.vars.stripe.hasOwnProperty('paymentIntentID')) {
// Send paymentMethod.id to server
CRM.api3('StripePaymentintent', 'Process', {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment