Automattic\WooCommerce\Gateways\PayPal
TransactAccountManager::get_transact_account_data
Get the Transact account (merchant or provider) data. Performs a fetch if the account is not in cache or expired.
Method of the class: TransactAccountManager{}
No Hooks.
Returns
Mixed. Returns null if the transact account cannot be retrieved.
Usage
$TransactAccountManager = new TransactAccountManager(); $TransactAccountManager->get_transact_account_data( $account_type );
- $account_type(string) (required)
- The type of account to get (merchant or provider).
Changelog
| Since 10.5.0 | Introduced. |
TransactAccountManager::get_transact_account_data() TransactAccountManager::get transact account data code WC 10.9.4
public function get_transact_account_data( string $account_type ) {
$cache_key = $this->get_cache_key( $account_type );
// Get transact account from cache. If not found, fetch/create it.
$transact_account = $this->get_transact_account_from_cache( $cache_key );
if ( empty( $transact_account ) ) {
$transact_account = 'merchant' === $account_type ? $this->fetch_merchant_account() : $this->fetch_provider_account();
// Fetch failed.
if ( empty( $transact_account ) ) {
return null;
}
// Update cache.
$this->update_transact_account_cache( $cache_key, $transact_account );
}
return $transact_account;
}