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_checkoutInstall the Gem:
bundle exec rails g spree_razorpay_checkout:installCompile Assets (Optional):
bin/rails assets:precompileStart Server:
foreman start -f Procfile.dev
Installation (For Docker)
Add Gem using docker compose:
docker compose run web bundle add spree_razorpay_checkoutInstall the Gem using Docker's Bundle Install:
docker compose run web bundle exec rails g spree_razorpay_checkout:installCompile Assests for Razorpay logo & assets (Recommended):
docker compose run web bundle exec rails assets:precompileRe-Start Server (Recommended):
docker compose down docker compose up -dUpgrade to Latest Version:
Change version in Spree's GemFile:
gem "spree_razorpay_checkout", "~> 0.1.1"Run Bundle Updator to Patch updated files:
bundle updateMigrate Database Tables (Recommended):
rails db:migrateRe-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 razorpayUpdate Gemfile:
bundle installRemove Migrations:
rm db/migrate/*_create_spree_razorpay_checkouts.spree_razorpay_checkout.rbOpen Rails Console:
rails c
5. Drop Razorpay Database:
```ruby
ActiveRecord::Base.connection.drop_table(:spree_razorpay_checkouts)
``````
6. Check Razorpay (You should see "nill"):
```ruby
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](https://razorpay.com/docs/payments/orders/apis/) | 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.