Skip to content

Commit b98448e

Browse files
committed
Breaking Change: shopify\access_token()
now directly returns the oauth access token.
1 parent 1172110 commit b98448e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: shopify.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,12 @@ function access_token($shop, $api_key, $shared_secret, $code)
4040
{
4141
try
4242
{
43-
return http\request("POST https://$shop/admin/oauth/access_token", array(), array('client_id'=>$api_key, 'client_secret'=>$shared_secret, 'code'=>$code));
43+
$response = http\request("POST https://$shop/admin/oauth/access_token", array(), array('client_id'=>$api_key, 'client_secret'=>$shared_secret, 'code'=>$code));
4444
}
4545
catch (http\CurlException $e) { throw new CurlException($e->getMessage(), $e->getCode(), $e->getRequest()); }
4646
catch (http\ResponseException $e) { throw new ApiException($e->getMessage(), $e->getCode(), $e->getRequest(), $e->getResponse()); }
47+
48+
return $response['access_token'];
4749
}
4850

4951

0 commit comments

Comments
 (0)