WC_Helper_API::add_auth_parameters
Add the access token and signature to the provided URL.
Method of the class: WC_Helper_API{}
No Hooks.
Returns
String.
Usage
$result = WC_Helper_API::add_auth_parameters( $url ): string;
- $url(string) (required)
- The URL to add the access token and signature to.
WC_Helper_API::add_auth_parameters() WC Helper API::add auth parameters code WC 10.5.0
public static function add_auth_parameters( string $url ): string {
$auth = WC_Helper_Options::get( 'auth' );
if ( empty( $auth['access_token'] ) || empty( $auth['access_token_secret'] ) ) {
return false;
}
$signature = self::create_request_signature( (string) $auth['access_token_secret'], $url, 'GET' );
return add_query_arg(
array(
'token' => $auth['access_token'],
'signature' => $signature,
),
$url
);
}