Shopify private app – get started
Fabian Blechschmidt
The documentation of shopify APIs is pretty good. Unfortunately I failed miserably to authenticate – and this is because from my point of view the naming of the PHP client is wrong – at least for private apps.
Big shout out to Fatih Samur whos blog entry helped me a lot!
This is the app info for private apps in the backend.
Context::initialize(
$_ENV['SHOPIFY_API_KEY'],
$_ENV['SHOPIFY_API_SECRET'],
$_ENV['SHOPIFY_APP_SCOPES'],
$_ENV['SHOPIFY_APP_HOST_NAME'],
new FileSessionStorage('/tmp/php_sessions'),
'2021-04',
true,
false,
);
And this is the code example of the shopify php client .
$_ENV['SHOPIFY_API_KEY'], // => API-Schlüssel (the value in the middle)
$_ENV['SHOPIFY_API_SECRET'], // => TOKEN(!!) NOT THE SECRET!
$_ENV['SHOPIFY_APP_SCOPES'], // => Whatever you defined, comma separated.
$_ENV['SHOPIFY_APP_HOST_NAME'], // => your host without https:// and / as suffix.
Hope that helps someone in the future.
Other articles from this category
PHPStorm/IDEA, composer updates and 100% CPU
In one of our projects PHPStorm ran a while on 100% CPU, an investigation showed, that the process „checking for available composer updates“ ran and used all the resources. Most likely it got stuck somewhere. To get rid of the problem, one can turn off this feature. In IDEA Ultimate here: [Settings] -> Languages & […]
Custom Fields, dots and MySQL’s JSON_EXTRACT
We all know custom fields – hopefully – at least this is not about the basics. You can add custom fields to nearly all entites: orders, products, categories, … You can name them whatever you like, e.g. pluginname.property – but using dots . in your custom field name is a bad idea, because then you […]
gpg failed to sign the data
I was doing some work, when suddenly my git failed to commit changed. I dig a little around, asked StackOverflow but it didn’t help. Finally when running the commit manually and not through PHPStorm I got a proper error: Ah! The key is expired! Got it. Did you know you can extend a GPG key? […]
Schreibe einen Kommentar