Store card processing gateway enabled config as a string.

This commit is contained in:
Narek Zakarian 2022-03-30 19:25:51 +04:00
parent d6286ec6e5
commit 243add3f02
2 changed files with 5 additions and 2 deletions

View file

@ -439,7 +439,7 @@ class CreditCardGateway extends \WC_Payment_Gateway_CC {
parent::init_settings();
// looks like in some cases WC uses this field instead of get_option.
$this->enabled = $this->is_enabled();
$this->enabled = $this->is_enabled() ? 'yes' : '';
}
/**
@ -468,7 +468,9 @@ class CreditCardGateway extends \WC_Payment_Gateway_CC {
$ret = parent::update_option( $key, $value );
if ( 'enabled' === $key ) {
$this->config->set( 'dcc_enabled', 'yes' === $value );
$this->config->set( 'enabled', 'yes' === $value );
$this->config->persist();
return true;