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

Usage Charge "ID on Null" Fix

Open Kyon147 opened this issue 1 year ago • 1 comments

Currently, the usage Charge method is trying to get the user from the session but it is not available.

This updates the route to expect the shop domain to be passed in like the other functions.

Kyon147 avatar Sep 11 '22 08:09 Kyon147

Hey @osiset

I've updated the usage charge wiki as it was not passing over the signature as a string but as it is breaking Call to a member function getId() on null after some digging, the user is never in the session.

As the other methods, just pass in the shop domain, it made sense to just keep it consistent.

When merged I'll update the wiki to pass in the shop domain also.

Issues relate:

#1166 #1044 #1002

Here's the charge in the DB successfully

image

Kyon147 avatar Sep 11 '22 10:09 Kyon147

Is there any need to add verify.shopify middleware to the usage_charge route when we pass the shop param with the URL?

nahid avatar Sep 27 '22 06:09 nahid

@nahid no need to pass the verify middleware, that is why the shop param is passed along. It also follows how the plan billing routes work, so it keeps the logic consistent with other parts of the app.

Kyon147 avatar Oct 01 '22 08:10 Kyon147

@osiset merged in #1222 now so if you are happy, will merge this into master and do a small patch release

Kyon147 avatar Oct 04 '22 07:10 Kyon147

@Kyon147 Go ahead :)

gnikyt avatar Oct 04 '22 15:10 gnikyt