Subscriptions
This guide is an introduction to Rhino Subscription module
Stripe Subscription
Rhino Subscriptions uses Stripe platform for subscriptions. Rhino existing integration uses stripe checkout which is interchangeable to a local checkout page if customized.
Integrating Rhino Subscriptions
Rhino subscriptions can be added by the following steps:
- Create an account in Stripe platform. Complete setting up the account and make sure the project business name is added here
- Apply the business model as one
product
and itsprices
on stripe. Note: Current setup supports one product and multiple plans. - Get Publishable key and Secret key from Stripe profile and use them in ENV variables as
STRIPE_PUBLISHABLE_KEY
andSTRIPE_SECRET_KEY
in server side andSTRIPE_PUBLISHABLE_KEY
in front side ENV. - Install Rhino Subscriptions module using this command:
rails rhino_subscriptions:install
then userails db:migrate
to complete migration of the newly added model. - Check everything is working and/or customize stripe experience. To checkout in test mode, use these test card numbers.
- Change your stripe profile from test mode to live mode.
How it works
Rhino API doc
api/subscription/prices
: Returns the related prices from stripe for UIapi/subscription/create_checkout_session
: Creates a new checkout session with the info to redirect to Stripe checkout page for payment and updates local model stripe_customerapi/subscription/subscriptions
: returns list of subscriptions customer has and their infoapi/subscription/customer
: returns local stripe customer info of a user
Read more
Find out more about Stripe major concepts used in this integration: