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.
Метод класса: TransactAccountManager{}
Хуков нет.
Возвращает
Разное. Returns null if the transact account cannot be retrieved.
Использование
$TransactAccountManager = new TransactAccountManager(); $TransactAccountManager->get_transact_account_data( $account_type );
- $account_type(строка) (обязательный)
- The type of account to get (merchant or provider).
Список изменений
| С версии 10.5.0 | Введена. |
Код TransactAccountManager::get_transact_account_data() TransactAccountManager::get transact account data WC 11.0.1
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;
}