mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-03 08:37:53 +08:00
Show notice if validation fails
This commit is contained in:
parent
22809839d1
commit
f227713f6c
4 changed files with 42 additions and 25 deletions
|
@ -43,15 +43,8 @@ class ApplepayButton {
|
|||
this.onButtonClick()
|
||||
})
|
||||
}
|
||||
jQuery.ajax({
|
||||
url: this.buttonConfig.ajax_url,
|
||||
type: 'POST',
|
||||
data: {
|
||||
action: 'ppcp_validate',
|
||||
validation: true,
|
||||
nonce: this.nonce,
|
||||
}
|
||||
})
|
||||
console.log('[ApplePayButton] init done', this.buttonConfig.ajax_url);
|
||||
|
||||
}
|
||||
|
||||
buildReadyToPayRequest(allowedPaymentMethods, baseRequest) {
|
||||
|
@ -182,7 +175,15 @@ class ApplepayButton {
|
|||
.then(validateResult => {
|
||||
session.completeMerchantValidation(validateResult.merchantSession);
|
||||
//call backend to update validation to true
|
||||
|
||||
jQuery.ajax({
|
||||
url: this.buttonConfig.ajax_url,
|
||||
type: 'POST',
|
||||
data: {
|
||||
action: 'ppcp_validate',
|
||||
validation: true,
|
||||
'woocommerce-process-checkout-nonce': this.nonce,
|
||||
}
|
||||
})
|
||||
console.log('validated')
|
||||
})
|
||||
.catch(validateError => {
|
||||
|
@ -194,7 +195,7 @@ class ApplepayButton {
|
|||
data: {
|
||||
action: 'ppcp_validate',
|
||||
validation: false,
|
||||
nonce: this.nonce,
|
||||
'woocommerce-process-checkout-nonce': this.nonce,
|
||||
}
|
||||
})
|
||||
session.abort();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue