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

When a user declines a charge, the return URL has no chargeId, causing 500 error

Open usmanpakistan opened this issue 2 years ago • 1 comments

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

  1. Install a new app or open the change plan screen of your app
  2. Select a different plan. You will be redirected to Shopify Charge page
  3. Do not approve the Charge and decline the charge by clicking on the cancel button.
  4. You will be redirected to Shopify admin, and will see the new setting popup.
  5. Close the popup, you will be redirected to /billing/process/{plan_id} page of the app
  6. 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

usmanpakistan avatar Jul 25 '22 19:07 usmanpakistan

@osiset @Kyon147 Can you people look into this. Thanks

usmanpakistan avatar Jul 26 '22 14:07 usmanpakistan

Closing this now it has been merged, thanks for the PR!

Kyon147 avatar Sep 07 '22 07:09 Kyon147