Automattic\WooCommerce\Gateways\PayPal

Helper::is_orders_v2_migration_eligiblepublic staticWC 1.0

Check if the merchant is eligible for migration from WPS to PPCP.

Method of the class: Helper{}

No Hooks.

Returns

true|false.

Usage

$result = Helper::is_orders_v2_migration_eligible(): bool;

Helper::is_orders_v2_migration_eligible() code WC 10.8.1

public static function is_orders_v2_migration_eligible(): bool {
	$settings = get_option( 'woocommerce_paypal_settings', array() );

	// If API keys are set, the merchant is not eligible for migration
	// as they may be using features that cannot be seamlessly migrated.
	$is_test_mode  = isset( $settings['testmode'] ) && 'yes' === $settings['testmode'];
	$api_username  = $is_test_mode ? ( $settings['sandbox_api_username'] ?? null ) : ( $settings['api_username'] ?? null );
	$api_password  = $is_test_mode ? ( $settings['sandbox_api_password'] ?? null ) : ( $settings['api_password'] ?? null );
	$api_signature = $is_test_mode ? ( $settings['sandbox_api_signature'] ?? null ) : ( $settings['api_signature'] ?? null );

	return empty( $api_username ) && empty( $api_password ) && empty( $api_signature );
}