laravel-shopify icon indicating copy to clipboard operation
laravel-shopify copied to clipboard

ShopDomain::fromRequest does not check all possible headers

Open mattias opened this issue 3 years ago • 1 comments

ShopDomain::fromRequest($request) fails finding the header with the shop domain in it because it is looking in the wrong places.

I do manual code to find the domain like this: $domain = ShopDomain::fromNative($request->header('x-shopify-shop-domain'));

::fromRequest(...) tries to find the 'X-Shop-Domain' header which does not exist.

This happens in a controller which is used for the CarrierService. So when the checkout loads all shipping methods, Shopify calls the route which executes this controller/action. The actual route has the middleware auth.webhook.

I'm wondering if this is a miss and if I should do a pull request and add it? Or if I'm supposed to do this in another way. All I want is to get the shop user in the controller.

mattias avatar Jul 26 '21 13:07 mattias

Please create a PR :)

gnikyt avatar Jul 30 '21 11:07 gnikyt

This looks like a super old issue, with the changes recently going to close but we can reopen if it still exists.

Kyon147 avatar Oct 05 '22 15:10 Kyon147