RecurringApplicationCharge and return_url implementation

RecurringApplicationCharge and return_url implementation

Madhulika
Shopify Partner
1 0 0

Hello,

 

We are trying to move our app from shopify_app version 18.x to 21.x. In the process, I am having difficulty in choosing the return url for RecurringApplicationCharge. 

 

In the past our return_url was of the format "myappurl//recurring_charge/callback"

This route was placed in a class inherited from Authenticated Controller. I could retrieve the charge using charge_id, use it and move to the root_url.

 

When we moved to shopify_app 21.4.0, this  return_url takes me to login screen where I am asked to  "Enter your shop domain to log in or install this app." 

If I change the return_url to "https://<store>.myshopify.com/admin/apps/<myapp>/charge_callback and I place the method in home_controller , shopify gives me charge_id as well as other params - host, shop, session. I am able to get the charge object by loading the offline session

 

 

 

 

session_offline = ShopifyAPI::Utils::SessionUtils.load_offline_session(shop:shopid)
recurring_application_charge = ShopifyAPI::RecurringApplicationCharge.find(session:session_offline, id:params[:charge_id])

 

 

 

 

My home_controller inherits from ApplicationController.

Is there a suggested implementation for the return_url and where and how it should be implemented.

Reply 1 (1)

ShopifyDevSup
Shopify Staff
1453 238 501

Hi Madhulika,

 

For discussions relating specifically to the shopify_app gem it's recommended to post on the public GitHub repository issue board which can be found here: https://github.com/Shopify/shopify_app/issues

 

Hope you have a great day

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog