Merge branch 'trunk' into PCP-66-unblock-ui-on-submit-checkout-error

This commit is contained in:
Emili Castells 2021-03-11 12:26:32 +01:00 committed by GitHub
commit f7bd7de3c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 945 additions and 136 deletions

View file

@ -19,9 +19,6 @@ class CheckoutActionHandler {
const errorHandler = this.errorHandler;
const formSelector = this.config.context === 'checkout' ? 'form.checkout' : 'form#order_review';
spinner.setTarget(formSelector);
spinner.block();
const formValues = jQuery(formSelector).serialize();
return fetch(this.config.ajax.create_order.endpoint, {
@ -53,8 +50,12 @@ class CheckoutActionHandler {
return {
createOrder,
onApprove:onApprove(this, this.errorHandler, this.spinner),
onError: (error) => {
onCancel: () => {
spinner.unblock();
},
onError: () => {
this.errorHandler.genericError();
spinner.unblock();
}
}
}