Skip to content
Snippets Groups Projects
Commit 47c1b85c authored by mattwire's avatar mattwire
Browse files

Fix error message on AJAX 500 error

parent 92bd4c7a
Branches
Tags
1 merge request!2096.8
......@@ -307,18 +307,21 @@
*/
stripePaymentIntentProcessFail: function(failObject) {
var error = ts('Unknown error');
if (failObject.hasOwnProperty('error_message')) {
// From an API4 exception
error = failObject.error_message;
}
else if (failObject.hasOwnProperty('statusText') && (failObject.statusText !== 'OK')) {
// A PHP exit can return 200 "OK" but we don't want to display "OK" as the error!
if (failObject.statusText === 'parsererror') {
error = ts('Configuration error - unable to process paymentIntent');
}
else {
error = failObject.statusText;
if (typeof failObject !== 'undefined') {
if (failObject.hasOwnProperty('error_message')) {
// From an API4 exception
error = failObject.error_message;
}
else
if (failObject.hasOwnProperty('statusText') && (failObject.statusText !== 'OK')) {
// A PHP exit can return 200 "OK" but we don't want to display "OK" as the error!
if (failObject.statusText === 'parsererror') {
error = ts('Configuration error - unable to process paymentIntent');
}
else {
error = failObject.statusText;
}
}
}
CRM.payment.displayError(error, true);
script.reloadReCAPTCHA();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment