Automattic\WooCommerce\Internal\Admin\Settings\PaymentProviders

AmazonPay::is_amazon_pay_onboardedprivateWC 1.0

Check if the AmazonPay payment gateway is onboarded.

For AmazonPay, there are two different environments: sandbox and production.

Method of the class: AmazonPay{}

No Hooks.

Returns

?true|false. True if the payment gateway is onboarded, false otherwise. Null if we failed to determine the onboarding status.

Usage

// private - for code of main (parent) class only
$result = $this->is_amazon_pay_onboarded(): ?bool;

AmazonPay::is_amazon_pay_onboarded() code WC 9.9.3

private function is_amazon_pay_onboarded(): ?bool {
	if ( class_exists( '\WC_Amazon_Payments_Advanced_API' ) &&
		is_callable( '\WC_Amazon_Payments_Advanced_API::validate_api_settings' ) ) {

		return true === \WC_Amazon_Payments_Advanced_API::validate_api_settings();
	}

	// Let the caller know that we couldn't determine the onboarding status.
	return null;
}