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
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
Related
I would like to accept payments on my NextJS + Rails (backend) application. The Rails backend handles bookings and has a few tables (user, bookings, etc). I want it to be as 'easy' as possible so Stripe Checkout seems to be a good fit.
However, I struggle to understand if I need to set up Stripe only using NextJS (front + NextJS API), or if I should do the backend part using the Rails server.
The Stripe docs only show the Stripe set up with NextJS (front) and NextJS api.
Thanks in advance for your help!
Hello 👋🏻 While the term “easy” is subjective, I think Stripe Checkout with Prebuilt Checkout page flow would be an ideal choice. It has a pretty solid guide to get started [1] as well as it requires a lot less code and offers various customization options.
All you have to do is;
Build a form on your NextJS frontend that makes a POST request on your backend
Build a route on your rails app that creates a Stripe Checkout session [2]
Then redirect the users to the Stripe hosted
checkout page
Stripe will take care of accepting the payments and sending users back to your app [3].
While there are no official example docs on Stripe Integration with Rails, you can tweak the Ruby + Sinatra snippets to fit into your rails app.
[1] https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=checkout
[2] https://stripe.com/docs/api/checkout/sessions/create?lang=ruby
[3] https://stripe.com/docs/api/checkout/sessions/create?lang=ruby#create_checkout_session-success_url
[4] https://stripe.com/docs/api/checkout/sessions/create?lang=ruby#create_checkout_session-cancel_url
[5] https://stripe.com/partners/pay-rails
I am developing an app for shopify app store in RoR and trying to use Shopify's new PriceRules API. But I am not able to make it work. I am using shopify-app gem and for price rules api I tries using:
ShopifyAPI::PriceRule
ShopifyAPI::PriceRules
but it throws following error :
uninitialized constant ShopifyAPI::PriceRule
Does anyone has any idea on how can I make it work in Ror?
Thanks.
Do a bundle open shopify_api and examine the resources. You probably won't find the new-ish PriceRules endpoint. So you have to make it yourself or wait if you want the official Shopify one.
If you are using RoR, then you almost certainly are using bundler. An alternative is to open the Shopify Gem shopify_api, and you'll see all the resources currently supported. If you wanted to add PriceRules endpoint, hack it into that gem.
Has anyone used the ActiveMerchant Stripe gateway to process recurring/subscription payments? If so, I'd love to see a code example.
There are a few references to 'recurring' in the gateway's source - https://github.com/Shopify/active_merchant/blob/master/lib/active_merchant/billing/gateways/stripe.rb, but I haven't been able to successfully supply a plan as described at https://stripe.com/docs/subscriptions.
Stripe has a Ruby gem, but I'd prefer to use ActiveMerchant b/c my Rails app is already using several other payment gateways.
Any help is much appreciated!
Stripe implementation at ActiveMerchant doesn't support recurring/subscription payments. In fact, most of the ActiveMerchant gateways integrations are with Shopify in mind. And 99.99% of Shopify transactions are one time transactions.
Take a look at the PayPal recurring solution at ActiveMerchant and you'll realize AM hasn't been focused at all on subscriptions.
Disclaimer: I work at MONEI.
I am making a Ruby on Rails app and I need to be able to bill users. I would like to use either PayPal, credit cards, or both. I looked at Saasy (https://github.com/maccman/saasy) but it requires one of three paid gateways, and I need a free gateway. Is there any way to do this for free?
Edit: Is it smart to do it on my own using the Railscasts PayPal tutorials?
There is no such thing as a free gateway.
The cheapest/best option in my opinion is run your site with Recurly and use Intuit Merchant Service instead of PayPal.
Recurly has tight integration with IMS, and they also have a very nice Gem that you can add to your rails app which makes managing accounts and billing in-app quite easy.
Try to use active_merchant
https://github.com/Shopify/active_merchant
I have been looking at paypal for a online transaction, but I wanted to know if there are other 3rd party vendor that offer a good service at a good price ( transaction fee) and ease of use of API for ruby on rails application.
Check out Braintree. There's a Braintree Ruby gem that makes integration easy, and pricing is very competitive. And you don't have to fear "the paypal call".
Authorize.net has a better pricing plan that PayFloPro by Paypal, with very similar functionality.