Message Fixed

This commit is contained in:
devansh bawari 2021-02-22 18:12:41 +05:30
parent fb8b0f64ca
commit 5388dc04dc
1 changed files with 11 additions and 2 deletions

View File

@ -21,7 +21,7 @@
};
window.onload = (function() {
eventBus.$on('after-payment-method-selected', function(payment) {
eventBus.$on('after-payment-method-selected', function (payment) {
if (payment.method != 'paypal_smart_button') {
$('.paypal-buttons').remove();
@ -40,6 +40,8 @@
shape: 'rect',
},
authorizationFailed: false,
enableStandardCardFields: false,
alertBox: function (message) {
@ -58,10 +60,11 @@
})
.catch(function (error) {
if (error.response.data.error === 'invalid_client') {
options.authorizationFailed = true;
options.alertBox(messages.authorizationError);
}
options.alertBox(messages.universalError);
return error;
});
},
@ -86,6 +89,12 @@
.catch(function (error) {
window.location.href = "{{ route('shop.checkout.cart.index') }}";
})
},
onError: function (error) {
if (! options.authorizationFailed) {
options.alertBox(error);
}
}
};