statamic-rad-pack / shopify

Integrate your Shopify products into Statamic using the Admin API.
https://statamic.com/addons/rad-pack/shopify
Other
8 stars 5 forks source link

Link Statamic customers from Shopify #194

Closed ryanhissey closed 1 year ago

ryanhissey commented 1 year ago

Prerequisites

Expected Behavior

I was expecting the user to be created and synced to shopify.

Current Behavior

The user is created within statamic, but never syncs to Shopify. An exception is also thrown here too.

Failure Information

Here is an example of when I try to make a user from the statamic CLI

Screenshot 2023-11-08 at 16 47 20

Error in Log: [2023-11-08 16:47:03] local.ERROR: Could not create user in Shopify {"exception":"[object] (Exception(code: 0): Could not create user in Shopify at /vendor/statamic-rad-pack/shopify/src/Jobs/CreateOrUpdateShopifyUser.php:61) [stacktrace]

A snippet of a dd illustrating the response in the rest client:

Screenshot 2023-11-09 at 23 18 13

Steps to Reproduce

php please make:user

or

Make a new user within the admin

Context

ryanmitchell commented 1 year ago

Did you add the correct permissions in your Shopify app: https://statamic-shopify-docs.vercel.app/CMS/customers#link-statamic-customers-from-shopify

ryanhissey commented 1 year ago

Hey @ryanmitchell,

Thanks for the reply. I have already added the correct permissions to the app.

Screenshot 2023-11-10 at 07 49 15
ryanmitchell commented 1 year ago

Yeah I think i see why - do you want to give the changes here a go and let me know if that solves it for you?

ryanhissey commented 1 year ago

@ryanmitchell - Unfortunately this does not fix the issue, That return should definitely be there though.

It looks like the error is still stemming from the 401 unauthorised, from the response in the rest client.

ryanmitchell commented 1 year ago

I've pushed some updates - verified it against a couple of our accounts. It's definitely working now. Attached a screenshot of the permissions we've enabled.

CleanShot 2023-11-10 at 16 54 02@2x

ryanhissey commented 1 year ago

Hmm how strange.

I've tested the code from your PR on my project, Still have the same issue. I've also triple-checked that all permissions are enabled.

Still the 401

ryanmitchell commented 1 year ago

Strange indeed, looks like some of your credentials arent right. I'm happy to work with you directly on it if you want to DM me on discord.