Automattic\WooCommerce\Gateways\PayPal

TransactAccountManager::get_cache_keyprivateWC 10.5.0

Get the cache key for the transact account.

Method of the class: TransactAccountManager{}

No Hooks.

Returns

String|null. The cache key, or null if the account type is invalid.

Usage

// private - for code of main (parent) class only
$result = $this->get_cache_key( $account_type ): ?string;
$account_type(string) (required)
The type of account to get (merchant or provider).

Changelog

Since 10.5.0 Introduced.

TransactAccountManager::get_cache_key() code WC 10.9.4

private function get_cache_key( string $account_type ): ?string {
	if ( 'merchant' === $account_type ) {
		return $this->gateway->testmode ? self::TRANSACT_MERCHANT_ACCOUNT_CACHE_KEY_TEST : self::TRANSACT_MERCHANT_ACCOUNT_CACHE_KEY_LIVE;
	}

	if ( 'provider' === $account_type ) {
		return $this->gateway->testmode ? self::TRANSACT_PROVIDER_ACCOUNT_CACHE_KEY_TEST : self::TRANSACT_PROVIDER_ACCOUNT_CACHE_KEY_LIVE;
	}

	return null;
}