mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
disable gateways when gateway setting 'enabled' is false
This commit is contained in:
parent
a609b6f90b
commit
cc1365d5e9
1 changed files with 6 additions and 0 deletions
|
@ -60,6 +60,12 @@ class DisableGateways {
|
|||
if ( ! isset( $methods[ PayPalGateway::ID ] ) && ! isset( $methods[ CreditCardGateway::ID ] ) ) {
|
||||
return $methods;
|
||||
}
|
||||
if ( ! $this->settings->has( 'enabled' ) || ! $this->settings->get( 'enabled' ) ) {
|
||||
|
||||
unset( $methods[ PayPalGateway::ID ] );
|
||||
unset( $methods[ CreditCardGateway::ID ] );
|
||||
return $methods;
|
||||
}
|
||||
if (
|
||||
! $this->settings->has( 'merchant_email' )
|
||||
|| ! is_email( $this->settings->get( 'merchant_email' ) )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue