gnikyt / laravel-shopify

A full-featured Laravel package for aiding in Shopify App development
MIT License
1.24k stars 374 forks source link

recurring_application_charges.json` resulted in a `403 Forbidden` response #377

Closed ghost closed 4 years ago

ghost commented 4 years ago

Expected Behavior

redirect to the plan selection page

Current Behavior

Client error: POST https://test-storevd.myshopify.com/admin/recurring_application_charges.json resulted in a 403 Forbidden response"

Failure Information

Please help provide information about the failure if this is a bug.

Steps to Reproduce

  1. Create App
  2. Install App
  3. Add plan
  4. error

Context

Error immediately after installing the package.

an error occurs when sending a POST request in confirmation Url () what could be the problem?

NikolayBalkandzhiyski commented 4 years ago

I'm facing the same issue.

Package Version: v10.2.1 Laravel Version: v5.8 PHP Version: v7.2

The error is returned from confirmationUrl() method, calling the API, not matter if the plan is recurring or one time payment:

$charge = $this->api->rest( 'POST', "/admin/{$this->plan->typeAsString(true)}.json", ["{$this->plan->typeAsString()}" => $this->chargeParams()] )->body->{$this->plan->typeAsString()};

message: "Client error: POST https://****.myshopify.com/admin/application_charges.json resulted in a 403 Forbidden response"

The plan "test" fields is not affecting the behavior also.

I wonder if this is the case here and charges cannot be tested at all on demo(test) shops. Copied from Shopify docs:

"Note For testing purposes you can include "test": true when creating the charge. This prevents the credit card from being charged. Test shops and demo shops can't be charged."

https://help.shopify.com/en/api/reference/billing/applicationcharge

ghost commented 4 years ago

did you find any solution?

I'm facing the same issue.

but it also says so.

For testing purposes you can include "test": true when creating the charge. This prevents the credit card from being charged. Test shops and demo shops can't be charged. this parameter is transmitted, so everything should work.

ghost commented 4 years ago

Created a new Public app and everything worked out. magic