Restricted API keys aren’t accepted
-
Restricted API keys aren’t accepted in live mode because they start with “rk_live” as a prefix. (Restricted API Test keys start with “rk_test”)
Under the file woocommerce-gateway-stripe.php the following code seems to stop the use of restricted API keys.
// Check if keys are entered properly per live/test mode. if ( $testmode ) { if ( ! empty( $test_pub_key ) && ! preg_match( '/^pk_test_/', $test_pub_key ) || ! empty( $test_secret_key ) && ! preg_match( '/^sk_test_/', $test_secret_key ) ) { $setting_link = $this->get_setting_link(); /* translators: 1) link */ $this->add_admin_notice( 'keys', 'notice notice-error', sprintf( __( 'Stripe is in test mode however your test keys may not be valid. Test keys start with pk_test and sk_test. Please go to your settings and, <a href="%s">set your Stripe account keys</a>.', 'woocommerce-gateway-stripe' ), $setting_link ), true ); } } else { if ( ! empty( $live_pub_key ) && ! preg_match( '/^pk_live_/', $live_pub_key ) || ! empty( $live_secret_key ) && ! preg_match( '/^sk_live_/', $live_secret_key ) ) { $setting_link = $this->get_setting_link(); /* translators: 1) link */ $this->add_admin_notice( 'keys', 'notice notice-error', sprintf( __( 'Stripe is in live mode however your test keys may not be valid. Live keys start with pk_live and sk_live. Please go to your settings and, <a href="%s">set your Stripe account keys</a>.', 'woocommerce-gateway-stripe' ), $setting_link ), true ); } } }
Viewing 12 replies - 1 through 12 (of 12 total)
Viewing 12 replies - 1 through 12 (of 12 total)
- The topic ‘Restricted API keys aren’t accepted’ is closed to new replies.