Automattic\WooCommerce\Internal\CLI\Migrator\Platforms\Webflow
WebflowClient::get_credentials
Validate that credentials are present.
Method of the class: WebflowClient{}
No Hooks.
Returns
Array|\WP_Error. Array with 'site_id' and 'access_token' keys, or WP_Error on failure.
Usage
// private - for code of main (parent) class only $result = $this->get_credentials();
WebflowClient::get_credentials() WebflowClient::get credentials code WC 11.0.0
private function get_credentials() {
if ( empty( $this->credentials['site_id'] ) || empty( $this->credentials['access_token'] ) ) {
return new \WP_Error(
'api_error',
'Webflow API credentials (site_id, access_token) are not configured. Please run: wp wc migrate setup --platform=webflow'
);
}
return array(
'site_id' => (string) $this->credentials['site_id'],
'access_token' => (string) $this->credentials['access_token'],
);
}