サイトがローカルまたはステージングサイトに設定されている場合、Stripe Woocommerceアドオンをテストモードにする方法を探しています。私は正しい方向に私を向けることができるリソースはまだ見つけていません。Force Stripe WooCommerce Addonをホスト名に応じてtestmodeに追加
は、私には、値の設定を取得しますクラス-WC-ゲートウェイstrip.phpのコード見つけた:
// Get setting values.
$this->title = $this->get_option('title');
$this->description = $this->get_option('description');
$this->enabled = $this->get_option('enabled');
$this->testmode = 'yes' === $this->get_option('testmode');
$this->capture = 'yes' === $this->get_option('capture', 'yes');
$this->stripe_checkout = 'yes' === $this->get_option('stripe_checkout');
$this->stripe_checkout_locale = $this->get_option('stripe_checkout_locale');
$this->stripe_checkout_image = $this->get_option('stripe_checkout_image', '');
$this->saved_cards = 'yes' === $this->get_option('saved_cards');
$this->secret_key = $this->testmode ? $this->get_option('test_secret_key') : $this->get_option('secret_key');
$this->publishable_key = $this->testmode ? $this->get_option('test_publishable_key') : $this->get_option('publishable_key');
$this->bitcoin = 'USD' === strtoupper(get_woocommerce_currency()) && 'yes' === $this->get_option('stripe_bitcoin');
$this->logging = 'yes' === $this->get_option('logging');
をそして私は、ドメインにチェックをやってみたこととupdate_option('testmode','yes');
を試してみましたが、それは」doesnの何の効果もないようです。
私の前進に役立つアイデアやリソースはありますか?
あなたは、実際のオプション名を見つけることができる場合は、[ 'pre_option_ $ option_name']を経由して、それをフィルタリングすることができるかもしれ(https://core.trac.wordpress.org/browser/tags/4.6/src/ wp-includes/option.php#L52) – helgatheviking
Nevermind、私は思う*すべてのストライプ設定は 'woocommerce_stripe_settings'の下に配列として保存されます。したがって、 'get_option(" woocommerce_stripe_settings ")'を実行し、結果の配列を操作し、新しいデータで 'update_option()'を操作する必要があります。 – helgatheviking