PHP Classes

Shopify API should be built in!

Recommend this page to a friend!

      PHP OAuth Library  >  PHP OAuth Library package blog  >  How to Implement PHP ...  >  All threads  >  Shopify API should be built in!  >  (Un) Subscribe thread alerts  
Subject:Shopify API should be built in!
Summary:Please add Shopify to the list of "out of the box providers"
Messages:5
Author:John Erck
Date:2015-02-17 19:16:53
 

  1. Shopify API should be built in!   Reply   Report abuse  
Picture of John Erck John Erck - 2015-02-17 19:16:53
In the meantime, what would the connection credentials be? Their oAuth docs are here: http://docs.shopify.com/api/authentication/oauth

  2. Re: Shopify API should be built in!   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2015-02-17 19:32:28 - In reply to message 1 from John Erck
Yes, I try to add Shopify support soon. I will follow up here when it is done.

Where do you see connection credentials? Could it be client credentials?


  3. Re: Shopify API should be built in!   Reply   Report abuse  
Picture of John Erck John Erck - 2015-02-17 19:56:27 - In reply to message 2 from Manuel Lemos
I am trying to setup the properties manually. Right now I have it setup as:

$client = new oauth_client_class();
$client->debug = true;
$client->debug_http = true;
$client->server = 'Shopify';
$client->client_id = $GLOBALS['env']->shopify_key;
$client->client_secret = $GLOBALS['env']->shopify_secret;
$client->configuration_file = '../vendor/phpclasses/oauth-api/oauth_configuration.json';
$client->server = 'Shopify';
$client->redirect_uri = 'https://nyclips.abovemarket.com/install';
$client->oauth_version = '2.0';
$client->dialog_url = 'https://nyclips-2.myshopify.com/admin/oauth/authorize?client_id={CLIENT_ID}&scope={SCOPE}&redirect_uri={REDIRECT_URI}&state={STATE}';
$client->access_token_url = 'https://nyclips-2.myshopify.com/admin/oauth/access_token';

However, when I run this code, Safari says, "Can't Open the Page - Too many redirects occurred trying to open https://nyclips.abovemarket.com/install?code=" Pic of error here: https://www.dropbox.com/s/jp52lzy30j8mf3k/Failed%20to%20open%20page.png?dl=0

Am I missing a key configuration parameter?

  4. Re: Shopify API should be built in!   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2015-02-17 20:15:03 - In reply to message 3 from John Erck
That may be a sign that PHP sessions may not be working well in your environment.

By default the class stores token state data in session variables. If session data is not being recorded, when Shopify redirects back to your site, it will start over thinking that the token state was never initialized.

Sometimes it is a matter of permissions on your Web server to access the directories where session data is stored.

  5. Re: Shopify API should be built in!   Reply   Report abuse  
Picture of John Erck John Erck - 2015-02-17 20:59:13 - In reply to message 4 from Manuel Lemos
Thank you for your reply. I will look into this further.