diff --git a/adminpages/wizard/save-steps.php b/adminpages/wizard/save-steps.php index 0c79792c5..93b1d9837 100644 --- a/adminpages/wizard/save-steps.php +++ b/adminpages/wizard/save-steps.php @@ -127,7 +127,7 @@ function pmpro_init_save_wizard_data() { // If Stripe is not already set up, and the user wants to use Stripe, then redirect them to Stripe Connect. $environment = apply_filters( 'pmpro_wizard_stripe_environment', 'live' ); - if ( ! empty( $_REQUEST['gateway'] ) && 'stripe' === sanitize_text_field( $_REQUEST['gateway'] ) && ! PMProGateway_Stripe::has_connect_credentials( $environment ) && ! PMProGateway_Stripe::using_legacy_keys() ) { + if ( ! empty( $_REQUEST['gateway'] ) && 'stripe' === sanitize_text_field( $_REQUEST['gateway'] ) && ! PMProGateway_Stripe::has_connect_credentials( $environment ) && ! PMProGateway_Stripe::using_api_keys() ) { $connect_url_base = apply_filters( 'pmpro_stripe_connect_url', 'https://connect.paidmembershipspro.com' ); $connect_url = add_query_arg( array( diff --git a/classes/class-pmpro-site-health.php b/classes/class-pmpro-site-health.php index b71e4488f..c97c89ecf 100644 --- a/classes/class-pmpro-site-health.php +++ b/classes/class-pmpro-site-health.php @@ -244,6 +244,7 @@ public function get_gateway() { $stripe = new PMProGateway_stripe(); $legacy = $stripe->using_legacy_keys(); + $api = $stripe->using_api_keys(); $connect = $stripe->has_connect_credentials(); if ( $legacy ) { @@ -251,6 +252,11 @@ public function get_gateway() { return $gateway_text . ' [' . $gateway . ':legacy-keys]'; } + if ( $api ) { + $gateway_text .= ' (' . __( 'API Keys', ' paid-memberships-pro' ) . ')'; + return $gateway_text . ' [' . $gateway . ':api-keys ]'; + } + if ( $connect ) { $gateway_text .= ' (' . __( 'Stripe Connect', 'paid-memberships-pro' ) . ')'; return $gateway_text . ' [' . $gateway . ':stripe-connect]'; diff --git a/classes/class-pmpro-wisdom-integration.php b/classes/class-pmpro-wisdom-integration.php index 7a16bdad6..f63b1284b 100644 --- a/classes/class-pmpro-wisdom-integration.php +++ b/classes/class-pmpro-wisdom-integration.php @@ -392,6 +392,7 @@ public function get_gateway_info() { // Get Stripe gateway info for other stats below. $stripe_using_legacy_keys = PMProGateway_stripe::using_legacy_keys(); + $stripe_using_api_keys = PMProGateway_stripe::using_api_keys(); $stripe_has_connect_credentials = PMProGateway_stripe::has_connect_credentials( 'live' ) || PMProGateway_stripe::has_connect_credentials( 'sandbox' ); // Append the Stripe gateway qualifiers. @@ -401,6 +402,10 @@ public function get_gateway_info() { $stats['pmpro_gateway'] .= ' (' . __( 'Legacy Keys', 'paid-memberships-pro' ) . ')'; } + if ( $stripe_using_api_keys ) { + $stats['pmpro_gateway'] .= ' (' . __( 'API Keys', 'paid-memberships-pro' ) . ')'; + } + // Add Stripe Connect text if using Stripe Connect. if ( $stripe_has_connect_credentials ) { $stats['pmpro_gateway'] .= ' (' . __( 'Stripe Connect', 'paid-memberships-pro' ) . ')'; @@ -418,7 +423,7 @@ public function get_gateway_info() { 'paypal' => get_option( 'pmpro_apiusername' ), 'paypalexpress' => get_option( 'paypalexpress_skip_confirmation' ), 'paypalstandard' => get_option( 'gateway_email' ), - 'stripe' => $stripe_using_legacy_keys || $stripe_has_connect_credentials, + 'stripe' => $stripe_using_legacy_keys || $stripe_using_api_keys || $stripe_has_connect_credentials, 'stripe_sandbox' => get_option( 'sandbox_stripe_connect_user_id' ), 'twocheckout' => get_option( 'twocheckout_accountnumber' ), ]; diff --git a/classes/gateways/class.pmprogateway_stripe.php b/classes/gateways/class.pmprogateway_stripe.php index dabe2e1d5..8d31d3df1 100644 --- a/classes/gateways/class.pmprogateway_stripe.php +++ b/classes/gateways/class.pmprogateway_stripe.php @@ -308,11 +308,11 @@ public static function pmpro_payment_option_fields( $values, $gateway ) { style="display: none;">
-

show_legacy_keys_settings() ) {?>style="display: none;">

+

show_legacy_keys_settings() ) {?>style="display: none;">

show_legacy_keys_settings() ) {?>

- +