Closed ncpope closed 6 years ago
Thank you for the note, I have adjusted this for next release.
Hi, I just left a comment on the commit but I'm not exactly sure whether or not it shows since I've never done one before, so I'll just post it here as well:
When displaying within an embedded app it will redirect which will cause the billing controller to try and create the charge more than once in the db. This causes an error like
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1234567890' for key 'charges_charge_id_unique'
https://github.com/ohmybrew/laravel-shopify/blob/4258693b3eb7430d426530faf1932cf70d1aa6cd/src/ShopifyApp/Traits/BillingControllerTrait.php#L51-L55
These lines could be changed to:
This will prevent the error and will select the charge rather than creating a new one.
https://github.com/ohmybrew/laravel-shopify/blob/4258693b3eb7430d426530faf1932cf70d1aa6cd/src/ShopifyApp/Traits/BillingControllerTrait.php#L83-L84
This could then become: