mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
Fix add payment method conflict with button event
This commit is contained in:
parent
dfd3f0cbe9
commit
cd8cfaf0b8
1 changed files with 2 additions and 1 deletions
|
@ -198,9 +198,10 @@ document.addEventListener(
|
|||
}
|
||||
|
||||
document.querySelector('#place_order')?.addEventListener("click", (event) => {
|
||||
const cardPaymentToken = document.querySelector('input[name="wc-ppcp-credit-card-gateway-payment-token"]:checked')?.value;
|
||||
if (
|
||||
getCurrentPaymentMethod() !== 'ppcp-credit-card-gateway'
|
||||
|| document.querySelector('input[name="wc-ppcp-credit-card-gateway-payment-token"]:checked')?.value !== 'new'
|
||||
|| cardPaymentToken && cardPaymentToken !== 'new'
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue