mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
disable option to store credit card details when on subscription
This commit is contained in:
parent
24df6eb814
commit
7c5918eba3
2 changed files with 10 additions and 3 deletions
|
@ -21,8 +21,13 @@ class CreditCardRenderer {
|
|||
wrapperElement.parentNode.removeChild(wrapperElement);
|
||||
return;
|
||||
}
|
||||
|
||||
//ToDo: Styles
|
||||
if (
|
||||
this.defaultConfig.enforce_vault
|
||||
&& document.querySelector(wrapper + ' .ppcp-credit-card-vault')
|
||||
) {
|
||||
document.querySelector(wrapper + ' .ppcp-credit-card-vault').checked = true;
|
||||
document.querySelector(wrapper + ' .ppcp-credit-card-vault').setAttribute('disabled', true);
|
||||
}
|
||||
paypal.HostedFields.render({
|
||||
createOrder: contextConfig.createOrder,
|
||||
fields: {
|
||||
|
@ -52,8 +57,9 @@ class CreditCardRenderer {
|
|||
|
||||
if (formValid) {
|
||||
|
||||
const vault = document.querySelector(wrapper + ' .ppcp-credit-card-vault') ?
|
||||
let vault = document.querySelector(wrapper + ' .ppcp-credit-card-vault') ?
|
||||
document.querySelector(wrapper + ' .ppcp-credit-card-vault').checked : false;
|
||||
vault = this.defaultConfig.enforce_vault || vault;
|
||||
|
||||
hostedFields.submit({
|
||||
contingencies: ['3D_SECURE'],
|
||||
|
|
|
@ -330,6 +330,7 @@ class SmartButton implements SmartButtonInterface
|
|||
'nonce' => wp_create_nonce(ApproveOrderEndpoint::nonce()),
|
||||
],
|
||||
],
|
||||
'enforce_vault' => $this->hasSubscription(),
|
||||
'bn_codes' => $this->bnCodes(),
|
||||
'payer' => $this->payerData(),
|
||||
'button' => [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue