mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-01 07:02:48 +08:00
Ensure vault enabled false on page load when reference transactions not enabled
This commit is contained in:
parent
53c2c96b8c
commit
8d1f45d19e
2 changed files with 5 additions and 5 deletions
|
@ -910,11 +910,6 @@ return array(
|
|||
unset( $fields['subscriptions_mode'] );
|
||||
}
|
||||
|
||||
$billing_agreements_endpoint = $container->get( 'api.endpoint.billing-agreements' );
|
||||
if ( ! $billing_agreements_endpoint->reference_transaction_enabled() ) {
|
||||
unset( $fields['vault_enabled'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Depending on your store location, some credit cards can't be used.
|
||||
* Here, we filter them out.
|
||||
|
|
|
@ -381,6 +381,11 @@ class SettingsListener {
|
|||
|
||||
$reference_transaction_enabled = $this->billing_agreements_endpoint->reference_transaction_enabled();
|
||||
|
||||
if ( $reference_transaction_enabled !== true ) {
|
||||
$this->settings->set( 'vault_enabled', false );
|
||||
$this->settings->persist();
|
||||
}
|
||||
|
||||
if ( $subscription_mode === 'vaulting_api' && $vault_enabled !== '1' && $reference_transaction_enabled === true ) {
|
||||
$this->settings->set( 'vault_enabled', true );
|
||||
$this->settings->persist();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue