From 3c2fcce2a4c24cc42f68cbf85de63845ac3ecf59 Mon Sep 17 00:00:00 2001 From: roykho Date: Tue, 20 Feb 2018 08:47:48 -0800 Subject: [PATCH] If main settings are not set, don't run apple pay registration --- includes/class-wc-stripe-apple-pay-registration.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/includes/class-wc-stripe-apple-pay-registration.php b/includes/class-wc-stripe-apple-pay-registration.php index f75698d3a..65ce576da 100644 --- a/includes/class-wc-stripe-apple-pay-registration.php +++ b/includes/class-wc-stripe-apple-pay-registration.php @@ -67,6 +67,11 @@ public function __construct() { $this->apple_pay_verify_notice = ''; $this->testmode = 'yes' === $this->get_option( 'testmode', 'no' ); $this->secret_key = $this->testmode ? $this->get_option( 'test_secret_key' ) : $this->get_option( 'secret_key' ); + + if ( empty( $this->stripe_settings ) ) { + return; + } + $this->init_apple_pay(); add_action( 'admin_notices', array( $this, 'admin_notices' ) );