mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 13:44:42 +08:00
Refresh checkout totals after validation if needed
Refreshing the totals the same way as WC does this.
This commit is contained in:
parent
c03b3d86b5
commit
3c557907f2
5 changed files with 47 additions and 11 deletions
|
@ -62,6 +62,11 @@ class CheckoutActionHandler {
|
|||
);
|
||||
} else {
|
||||
errorHandler.clear();
|
||||
|
||||
if (data.data.refresh) {
|
||||
jQuery( document.body ).trigger( 'update_checkout' );
|
||||
}
|
||||
|
||||
if (data.data.errors?.length > 0) {
|
||||
errorHandler.messages(data.data.errors);
|
||||
} else if (data.data.details?.length > 0) {
|
||||
|
|
|
@ -23,6 +23,10 @@ export default class FormValidator {
|
|||
const data = await res.json();
|
||||
|
||||
if (!data.success) {
|
||||
if (data.data.refresh) {
|
||||
jQuery( document.body ).trigger( 'update_checkout' );
|
||||
}
|
||||
|
||||
if (data.data.errors) {
|
||||
return data.data.errors;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue