Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

After login, app doesn't redirect to the billing route #66

Closed
sbkl opened this issue Aug 13, 2018 · 7 comments
Closed

After login, app doesn't redirect to the billing route #66

sbkl opened this issue Aug 13, 2018 · 7 comments

Comments

@sbkl
Copy link

sbkl commented Aug 13, 2018

Hi,

In the login screen, I enter the shop name which redirect to the shopify screen to install the app. Then, I go back to the login screen instead of seeing the charge screen.

When I enter my domain with the billing route manually, then I can accept the charge.

Is this a bug or something I'm doing wrong?

Thank you.

@gnikyt
Copy link
Owner

gnikyt commented Aug 14, 2018

Do you have billing enabled and setup? I can not reproduce this :/

@sbkl
Copy link
Author

sbkl commented Aug 14, 2018

Thanks for quick answer,
Yes, I have enabled billing in my .env file. When I enter the billing route manually, it works properly. The issue is just that when the app is installed, it redirect to the login route instead of billing.
Do I need to add the billing route to the Whitelisted redirection URL(s) in the shopify dashboard?

@gnikyt
Copy link
Owner

gnikyt commented Aug 14, 2018

No it should take you there (assuming you mean the base app route). Without knowing your full setup or database its hard to say whats up there.

@sbkl
Copy link
Author

sbkl commented Aug 14, 2018

Understand it is not easy for you to help without more details. Below some more details about the configuration. Let me know if this helps...

composer.json
"ohmybrew/laravel-shopify": "^3.0"

Providers, alias and middleware:
followed documentation.

note:

\OhMyBrew\ShopifyApp\ShopifyAppProvider::class,

has been added before

App\Providers\RouteServiceProvider::class,

migration:
I ran the following command:

php artisan vendor:publish --tag=migrations && php artisan migrate

As mentioned, the app installation is working properly and I can see the shop in the database once I have authorised my app in the shopify admin panel. Then, when I enter the route billing manually then the charge is showing in my database and shopify is confirming the charge (I see it in my store admin panel app directory and I receive a confirmation email from shopify).

config:
I ran the following command and didn't touch anything in the shopify-app.php file

php artisan vendor:publish --tag=config

.env file:
SHOPIFY_APP_NAME="my-shopify-app"
SHOPIFY_API_KEY=myshopifyapikey
SHOPIFY_API_SECRET=myshopifyapisecret
SHOPIFY_BILLING_ENABLED=1
SHOPIFY_BILLING_TYPE=recurring
SHOPIFY_BILLING_PLAN_NAME="recurring plan"
SHOPIFY_BILLING_PRICE=10.00
SHOPIFY_BILLING_TRIAL_DAYS=14
SHOPIFY_BILLING_TEST=1

In the shopify app setup:

APP URL:
https://my-url.test/
(I ran valet secure to get the https working)

Whitelisted redirection URL(s):
https://my-url.test/authenticate

@paulcanning
Copy link

paulcanning commented Aug 16, 2018

I found the issue, in my case at least.

I had my own Route set for the home page, following instructions from here.

You'll notice it is missing the billable middleware, which is set in the default route provided by the package.

I simply removed my override, and now the billing check is in place correctly.

@sbkl please check your own routes/web.php :)

@sbkl
Copy link
Author

sbkl commented Aug 16, 2018

@paulcanning Did the trick! Thank you for looking into this.

@sbkl sbkl closed this as completed Aug 16, 2018
@gnikyt
Copy link
Owner

gnikyt commented Aug 16, 2018

Thanks @paulcanning, just updated the wiki for this... I don't believe I had billing at the time when I wrote it - makes sense now! I've also updated the verbiage to be more clear.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants