Automattic\WooCommerce\Internal\Admin\Settings\PaymentProviders
PaymentGateway::is_in_test_mode_onboarding
Try to determine if the payment gateway is in test mode onboarding (aka sandbox or test-drive).
This is a best-effort attempt, as there is no standard way to determine this. Trust the true value, but don't consider a false value as definitive.
Method of the class: PaymentGateway{}
No Hooks.
Returns
true|false
. True if the payment gateway is in test mode onboarding, false otherwise.
Usage
$PaymentGateway = new PaymentGateway(); $PaymentGateway->is_in_test_mode_onboarding( $payment_gateway ): bool;
- $payment_gateway(WC_Payment_Gateway) (required)
- The payment gateway object.
PaymentGateway::is_in_test_mode_onboarding() PaymentGateway::is in test mode onboarding code WC 9.8.5
public function is_in_test_mode_onboarding( WC_Payment_Gateway $payment_gateway ): bool { // Try various gateway methods to check if the payment gateway is in test mode onboarding. if ( is_callable( array( $payment_gateway, 'is_test_mode_onboarding' ) ) ) { return filter_var( $payment_gateway->is_test_mode_onboarding(), FILTER_VALIDATE_BOOLEAN ); } if ( is_callable( array( $payment_gateway, 'is_in_test_mode_onboarding' ) ) ) { return filter_var( $payment_gateway->is_in_test_mode_onboarding(), FILTER_VALIDATE_BOOLEAN ); } return false; }