RECURRING PAYMENT IN STRIPE, SUBSCRIPTION PAYMENT IN STRIPE RAILS

Using Recurring Payment (Subscription Based) Rails Quickly integrate Recurring payment into your Ruby on Rails-based site to provide your users with a streamlined, mobile-ready payment experience. Getting started The first step is adding the Stripe gem to your application’s Gemfile: gem 'stripe' Then, run bundle install to install the gem. https://dashboard.stripe.com/account/apikeys Create config/initializers/stripe.rb : Rails.configuration.stripe = { publishable_key: Rails.application.secrets.stripe_publishable_key, secret_key: Rails.application.secrets.stripe_secret_key } Stripe.api_key = Rails.configuration.stripe[:secret_key] We will use testing keys for the development environment. For production environment you need to configure with live keys to receive real payments. Add these keys at config/secrets.yml : development: stripe_publishable_key: pk_test_xxxxxxxxxxxxxxxxxxxxxxxx stripe_secret_key: sk_test_xxxxxxxxxxxxxxxxx