Skip to content

Commit

Permalink
Breaking Change: shopify\access_token()
Browse files Browse the repository at this point in the history
 now directly returns the oauth access token.
  • Loading branch information
sandeepshetty committed Dec 10, 2014
1 parent 1172110 commit b98448e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion shopify.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@ function access_token($shop, $api_key, $shared_secret, $code)
{
try
{
return http\request("POST https://$shop/admin/oauth/access_token", array(), array('client_id'=>$api_key, 'client_secret'=>$shared_secret, 'code'=>$code));
$response = http\request("POST https://$shop/admin/oauth/access_token", array(), array('client_id'=>$api_key, 'client_secret'=>$shared_secret, 'code'=>$code));
}
catch (http\CurlException $e) { throw new CurlException($e->getMessage(), $e->getCode(), $e->getRequest()); }
catch (http\ResponseException $e) { throw new ApiException($e->getMessage(), $e->getCode(), $e->getRequest(), $e->getResponse()); }

return $response['access_token'];
}


Expand Down

0 comments on commit b98448e

Please sign in to comment.