mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
🐛 Fix fallback logic when vaulting is disabled
Added condition to handle incorrect condition: hardcoded default setting did ignore the form's input value.
This commit is contained in:
parent
85bd842c7a
commit
b753cf1ec9
1 changed files with 12 additions and 1 deletions
|
@ -394,7 +394,18 @@ class SettingsListener {
|
|||
|
||||
if ( $reference_transaction_enabled !== true ) {
|
||||
$this->settings->set( 'vault_enabled', false );
|
||||
$this->settings->set( 'subscriptions_mode', 'subscriptions_api' );
|
||||
|
||||
/**
|
||||
* If Vaulting-API was previously enabled, then fall-back to the
|
||||
* PayPal subscription mode, to ensure subscriptions are still
|
||||
* possible on this shop.
|
||||
*
|
||||
* This can happen when switching to a different PayPal merchant account
|
||||
*/
|
||||
if ( 'vaulting_api' === $subscription_mode ) {
|
||||
$this->settings->set( 'subscriptions_mode', 'subscriptions_api' );
|
||||
}
|
||||
|
||||
$this->settings->persist();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue