Skip to main content
Version: v3.0

Subscriptions

Rhino Subscriptions provides recurring billing using the stripe platform.

Integrating Rhino Subscriptions

Rhino subscriptions can be added by the following steps:

  1. Create an account in Stripe platform. Complete setting up the account and make sure the project business name is added here
  2. Apply the business model as product and prices on stripe.
  3. Get Publishable key and Secret key from Stripe profile and use them in ENV variables as VITE_STRIPE_PUBLISHABLE_KEY and STRIPE_SECRET_KEY.
  4. Install Rhino Subscriptions module using this command: rails rhino_subscriptions:install then use rails db:migrate to complete migration of the newly added model.
  5. Check everything is working and/or customize stripe experience. To checkout in test mode, use these test card numbers.
  6. Change your stripe profile from test mode to live mode and set the live keys in ENV variables.

How it works

How it works

Rhino API doc

  • api/subscription/prices: Returns the related prices from stripe for UI
  • api/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_customer
  • api/subscription/cancel: Cancel the existing subscription
  • api/subscription/subscriptions: returns list of subscriptions customer has and their info
  • api/subscription/customer: returns local stripe customer info of a user

Read more

Find out more about Stripe major concepts used in this integration: