Stripe Payment Gateway
Last updated
Was this helpful?
Last updated
Was this helpful?
We use stripe checkout and pay gem for easy paywall setup and webhooks. To start using Stripe follow this guide:
Go to and create an account.
For us to listen to stripe webhooks and test in development, we need to install stripe CLI in our terminal:
For macOS:
Or for Ubuntu, check the
Then login:
This should ask you for an API key, you will find it in > Secret Key
Start listening to your webhook events by running in your terminal:
Add the API Keys in the Rails credentials file. Open the file from the terminal with the following line:
Add the keys in the file with this exact wording for the keys and save:
Go to application.rb and replace the example domain with your domain so Pay can generate links (for features like Stripe Checkout).
Create a product on the stripe product catalog, copy the product ID, and paste it on the checkouts_controller.rb action Show:
Now that you have created your product on Stripe, ensure all the UI has the correct pricing, and modify the price on the _price_cards.rb component.
Hide your premium features behind the paywall by adding the following line in the premium controllers/actions
This webhook comes by default with the pay gem. If you wish to create custom webhooks refer to the documentation.
All the setup is taken care of by LightningRails, the only setup needed from your side to get the gem to work is: