This Razorpay Checkout Reprository is mentioned in official Spree Commerce Docs.
Razorpay Extension for Spree Commerce v5.2
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 (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
Upgrade to Latest Version:
-
Change version in Spree's GemFile:
gem "spree_razorpay_checkout", "~> 0.1.1"
-
Run Bundle Updator to Patch updated files:
bundle update
-
Migrate Database Tables (Recommended):
rails db:migrate
-
Re-Start Server (Recommended):
bin/rails restart
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".
Roadmap
| Features | Progress | Status |
|---|---|---|
| Auto-Capture Order in Razorpay | Working | ✅ |
| Test Button for Testmode | Working | ✅ |
| Razorpay order creation using OrdersAPI | Working | ✅ |
| Fetching Exact Total Amount in Modal | Working | ✅ |
| Order Creation after Successful Payment | Working | ✅ |
| Razorpay Logo in Admin/Order's Page | Working | ✅ |
| Admin side "Capture" order button | Working | ✅ |
| Admin side "Cancel" order button | Working | ✅ |
| Admin side "Refund" order button | Pending | ❌ |
| E-Mail after successful order | Working | ✅ |
| Disable Pay Button for Accidental Order | Working | ✅ |
| Razorpay Affordability Widget in Product Details Page | Upcoming | ⏳ |
Contributing
Contributions are welcome! Please open issues or submit pull requests to help improve this plugin for the Spree + Razorpay community in India.
