Skip to content

Creates a recurring application charge fails in production #1341

@felixding

Description

@felixding

I'm trying to create a recurring application charge as follows:

recurring_application_charge = ShopifyAPI::RecurringApplicationCharge.new(session: Shop.first.shopify_session)
recurring_application_charge.name = "Super Duper Plan"
recurring_application_charge.price = 10.0
recurring_application_charge.return_url = "http://super-duper.shopifyapps.com/"
recurring_application_charge.save!

It works well in development with recurring_application_charge.test = true.

But it fails in production (after removing recurring_application_charge.test = true, of course).

The API returns {"error_reference":"If you report this error, please include this id: 60dcfc7c-08b1-433d-a16a-78d5f8827616-1727746893."}

The Shopify session is valid. I can get the product images using the same session:

Loading production environment (Rails 7.1.3.3)
irb(main):001> Shop.first.product_images
W, [2024-10-02T01:28:33.734932 #1]  WARN -- : Deprecated request to Shopify API at products.json, received reason: https://shopify.dev/api/admin-rest/latest/resources/product
=>
["https://cdn.shopify.com/s/files/1/0829/7712/8724/products/gift_card.png?v=1695028426",
 "https://cdn.shopify.com/s/files/1/0829/7712/8724/products/snowboard_wax.png?v=1695028430",
 ...]

But as mentioned above, this failed:

irb(main):002> recurring_application_charge = ShopifyAPI::RecurringApplicationCharge.new(session: Shop.first.shopify_session)
irb(main):003> recurring_application_charge.name = "Super Duper Plan"
irb(main):004> recurring_application_charge.price = 10.0
irb(main):005> recurring_application_charge.return_url = "http://super-duper.shopifyapps.com"
irb(main):006> recurring_application_charge.test = nil
irb(main):007> recurring_application_charge.save!
(irb):7:in `<main>': {"error_reference":"If you report this error, please include this id: c06a3502-358d-442e-8728-fb38f40ef254-1727832529."} (ShopifyAPI::Errors::HttpResponseError)

Why?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions