Kyon147 / laravel-shopify

A full-featured Laravel package for aiding in Shopify App development
MIT License
363 stars 107 forks source link

Not getting redirected to charge step? #226

Closed ashdevelops closed 11 months ago

ashdevelops commented 11 months ago

I have followed everything listed here to enable billing: https://github.com/Kyon147/laravel-shopify/wiki/Creating-a-Billable-App

Expected Behavior

I'm redirected to a charge pre-authorization screen.

Current Behavior

App is installed without charge authorization

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. Install v19.0 of package with latest Laravel
  2. Install from fresh shopify app
  3. Notice how it doesn't show charge authorization screen

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

Kyon147 commented 11 months ago

@ashdevelops are you using blade template or SPA? Do your routes have the billable middleware on them?

ashdevelops commented 11 months ago

Hi @Kyon147 I am using blade templates. Also I am using the default installation routes which states it has billable middleware by default on these ones.

Kyon147 commented 11 months ago

@ashdevelops you still need to add billable middleware to all the routes including the home route. Otherwise you won't be redirected to the billing screen

ashdevelops commented 11 months ago

Thanks I've added billable, but now auth()->user() is null when trying to fetch the plan upon installing so I can't confirm if it fixed the charge redirect. Is there a reason for this?

Kyon147 commented 11 months ago

Have you made sure you have both middleware on the route i.e ['billable','verify.shopify']

Kyon147 commented 11 months ago

Going to close this as I can not replicate and it sounds like you might be missing both middleware. Re-open if still an issue.