mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 17:51:41 +08:00
Implement update_option
method in PayPal gateway to synchronize gateway enabled option
This commit is contained in:
parent
56e8493017
commit
008fcbc5f9
1 changed files with 16 additions and 0 deletions
|
@ -381,4 +381,20 @@ class PayPalGateway extends \WC_Payment_Gateway {
|
||||||
|
|
||||||
return parent::get_transaction_url( $order );
|
return parent::get_transaction_url( $order );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updates WooCommerce gateway option.
|
||||||
|
*
|
||||||
|
* @param string $key The option key.
|
||||||
|
* @param string $value The option value.
|
||||||
|
* @return bool|void
|
||||||
|
*/
|
||||||
|
public function update_option( $key, $value = '' ) {
|
||||||
|
parent::update_option( $key, $value );
|
||||||
|
|
||||||
|
if ( 'enabled' === $key ) {
|
||||||
|
$this->config->set( 'enabled', 'yes' === $value );
|
||||||
|
$this->config->persist();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue