Automattic\WooCommerce\Internal\CLI\Migrator\Platforms\Shopify
ShopifyClient::get_credentials
Get Shopify API credentials.
Метод класса: ShopifyClient{}
Хуков нет.
Возвращает
Массив|\WP_Error. Array with 'domain' and 'access_token' keys, or WP_Error on failure.
Использование
// private - только в коде основоного (родительского) класса $result = $this->get_credentials();
Код ShopifyClient::get_credentials() ShopifyClient::get credentials WC 10.8.1
private function get_credentials() {
if ( empty( $this->credentials['shop_url'] ) || empty( $this->credentials['access_token'] ) ) {
return new \WP_Error(
'api_error',
'Shopify API credentials (shop_url, access_token) are not configured. Please run: wp wc migrate setup'
);
}
// Map the stored credential keys to the expected format.
return array(
'domain' => $this->credentials['shop_url'],
'access_token' => $this->credentials['access_token'],
);
}