I will like to setup a free trial in my shopify rails app. I am using the official Shopify Rails app gem https://github.com/Shopify/shopify_app. The config for billing looks like this
config.billing = ShopifyApp::BillingConfiguration.new(
charge_name: "Apps",
amount: 6.99,
interval: ShopifyApp::BillingConfiguration::INTERVAL_EVERY_30_DAYS,
currency_code: "USD", # Only supports USD for now)
How do I add an option for free trial ? I have had a look at this documentation https://shopify.dev/apps/billing/purchase-adjustments/free-trials but I dont think the api for a free trial is included in the config of the shopify rails gem
2
Answers
I don’t remeber that free trials are supported by the Shopify Billing API.
In the past I needed to implement the free trial functionality myself, outside of the Shopify Rails gem.
One way you could do this is by creating a new plan in your app that is free, and then using the Shopify API to create a new recurring application charge for that plan
At the moment shopify_app gem doesn’t support adding
test
property when creating a new charge.If you really want to add it you gonna have to implement it yourself.
Here is how