Kyon147 / laravel-shopify

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

Getting 403 error when redirecting user to the select the recurring plan #348

Closed chintankotadia closed 3 weeks ago

chintankotadia commented 4 weeks ago

I have submitted my application for review to the Shopify team but they're getting a 403 Forbidden error when selecting the plan and redirecting to the charges approval.

Error details

[previous exception] [object] (GuzzleHttp\\Exception\\ClientException(code: 403): Client error: `POST https://eed289-2.myshopify.com/admin/recurring_application_charges.json` resulted in a `403 Forbidden` response at /var/www/app/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113)
[stacktrace]

Following are my configurations in billing :

SHOPIFY_BILLING_ENABLED=0
SHOPIFY_BILLING_FREEMIUM_ENABLED=1

Plans in the DB

+----+-----------+----------+-----------------------------------------------+-------+---------------+---------------+-------+------------+------+------------+------------+------------+
| id | type      | name     | description                                   | price | interval      | capped_amount | terms | trial_days | test | on_install | created_at | updated_at |
+----+-----------+----------+-----------------------------------------------+-------+---------------+---------------+-------+------------+------+------------+------------+------------+
|  1 | RECURRING | Startup  | ["1,000 orders a month", "14-day free trial"] | 29.00 | EVERY_30_DAYS |          0.00 | NULL  |         14 |    0 |          0 | NULL       | NULL       |
|  2 | RECURRING | Growth   | ["2,500 orders a month", "14-day free trial"] | 49.00 | EVERY_30_DAYS |          0.00 | NULL  |         14 |    0 |          0 | NULL       | NULL       |
|  3 | RECURRING | Advanced | ["5,000 orders a month", "14-day free trial"] | 69.00 | EVERY_30_DAYS |          0.00 | NULL  |         14 |    0 |          0 | NULL       | NULL       |
+----+-----------+----------+-----------------------------------------------+-------+---------------+---------------+-------+------------+------+------------+------------+------------+

Context

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

Am I missing any configuration or do I need to keep the billing in test mode when Shopify team is reviewing the app?

Please note that billing does work on test mode with the development store in staging/development environment.

Thank you

gofortiss commented 4 weeks ago

Try to increase the capped_amount

Kyon147 commented 3 weeks ago

Hi @chintankotadia

If your SHOPIFY_BILLING_ENABLED is set to 0 then you've turned off the billing middleware that is needed. Is there any reason why you've turned it off?

Kyon147 commented 3 weeks ago

Looking at the error https://eed289-2.myshopify.com/admin/recurring_application_charges.json the Shopify API is returning you don't have permission for some reason. Is this a public app?

chintankotadia commented 3 weeks ago

@Kyon147: There was a configuration issue while releasing the application. My client chose the managed pricing instead of Billing API. Thank you for looking into this one. Thank you.

Kyon147 commented 3 weeks ago

@chintankotadia glad you managed to get it sorted.