Subscriptions
Rhino Subscriptions provides recurring billing using the stripe platform.
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
product
andprices
on stripe. - Get Publishable key and Secret key from Stripe profile and use them in ENV variables as
VITE_STRIPE_PUBLISHABLE_KEY
andSTRIPE_SECRET_KEY
. - 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 and set the live keys in ENV variables.
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/cancel
: Cancel the existing subscriptionapi/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: