laravel-shopify
laravel-shopify copied to clipboard
When a user declines a charge, the return URL has no chargeId, causing 500 error
Expected Behavior
When a user decline a charge, he is redirected to Shopify Settings page as charge decline is handled by Shopify since 2018. When a user closes the setting popup, it should be redirected to App home page
Current Behavior
Problem is, on closing the popup, the user is redirected to the return URL, i.e. billing/process/{plan_id}/?shop=myshop.myshopify.com. The return URL, in case of decliced charge, does not contain the charge ID. This causes the route to show an error.
Failure Information
Billing process page shows an error if chargeId is missing from the query string
Steps to Reproduce
- Install a new app or open the change plan screen of your app
- Select a different plan. You will be redirected to Shopify Charge page
- Do not approve the Charge and decline the charge by clicking on the cancel button.
- You will be redirected to Shopify admin, and will see the new setting popup.
- Close the popup, you will be redirected to /billing/process/{plan_id} page of the app
- The page shows 500 error
Context
- Package Version: v17.1.0
- Laravel Version: v8.76
- PHP Version: v7.4
Failure Logs
See the screencast here https://gyazo.com/fae78b8d3653141dbdd0fcabef63924c
@osiset @Kyon147 Can you people look into this. Thanks
Closing this now it has been merged, thanks for the PR!