Razorpay Extension for Spree Commerce v5
RazorPay is the only payments solution in India that allows businesses to accept, process and disburse payments with its product suite.
Installation
-
Add Gem:
bundle add spree_razorpay_checkout
-
Install the Gem:
bundle exec rails g spree_razorpay_checkout:install
-
Compile Assets (Optional):
bin/rails assets:precompile
-
Start Server:
foreman start -f Procfile.dev
Installation (Traditional)
-
Add this to your Gemfile with this line:
gem 'spree_razorpay_checkout'
-
Install the Gem using Bundle Install:
bundle install
-
Copy & Run Migrations:
bundle exec rails g spree_razorpay_checkout:install
-
Compile Assests for Proper Images & JS loading:
RAILS_ENV=development bin/rails assets:precompile
-
Start Server:
foreman start -f Procfile.dev
Installation (For Docker)
-
Add Gem using docker compose:
docker compose run web bundle add spree_razorpay_checkout
-
Install the Gem using Docker's Bundle Install:
docker compose run web bundle exec rails g spree_razorpay_checkout:install
-
Compile Assests for Razorpay logo & assets (Recommended):
docker compose run web bundle exec rails assets:precompile
-
Re-Start Server (Recommended):
docker compose down docker compose up -d
Plugin Configuration
-
Get keys from Razorpay Dashboard here.
-
Make Sure to include both Razorpay Live & Test Keys from Razorpay Dashboard:

- Drag Razorpay to Top in Payment Methods to make it Default:

Checkout View
- Checkout Page:

- Razorpay Modal to Capture Payments:

- Order Page (Customer View):

- Order Page (Admin View):

Thankyou for supporting this plugin. if you find any issues related to plugin you are open to contribute and support which can help more Spree users in India.
Gem Info
Uninstallation
-
Uninstall Gem:
gem uninstall spree_razorpay_checkout gem uninstall razorpay
-
Update Gemfile:
bundle install
-
Remove Migrations:
rm db/migrate/*_create_spree_razorpay_checkouts.spree_razorpay_checkout.rb
-
Open Rails Console:
rails c
-
Drop Razorpay Database:
ActiveRecord::Base.connection.drop_table(:spree_razorpay_checkouts)
-
Check Razorpay (You should see "nill"):
defined?(Razorpay) # => nil
Note: If you see "nill" then Razorpay is completely uninstalled from Spree commerce, either if you see "constant" try "gem uninstall razorpay" & "bundle update".
Contributing
Contributions are welcome! Please open issues or submit pull requests to help improve this plugin for the Spree + Razorpay community in India.