Message Fixed
This commit is contained in:
parent
fb8b0f64ca
commit
5388dc04dc
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue