Automattic\WooCommerce\Internal\Admin\Settings\PaymentsProviders

Komoju::is_in_test_mode_onboarding │ public │ WC 1.0

Try to determine if the payment gateway is in test mode onboarding (aka sandbox).

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: Komoju{}

No Hooks.

Returns

bool. True if the payment gateway is in test mode onboarding, false otherwise.

Usage

$Komoju = new Komoju();
$Komoju->is_in_test_mode_onboarding( $payment_gateway ): bool;
$payment_gateway(WC_Payment_Gateway) (required)
The payment gateway object.

Komoju::is_in_test_mode_onboarding() code WC 11.1.2

public function is_in_test_mode_onboarding( WC_Payment_Gateway $payment_gateway ): bool {
	// A `sk_test_` key is a sandbox credential, so the account itself is a test account,
	// not just a live account processing test payments. KOMOJU exposes no separate
	// onboarding environment signal, so the same check answers both questions.
	return $this->is_komoju_in_sandbox_mode( $payment_gateway ) ?? parent::is_in_test_mode_onboarding( $payment_gateway );
}