razorpay

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

  1. Add Gem:

    bundle add spree_razorpay_checkout
    
  2. Install the Gem:

    bundle exec rails g spree_razorpay_checkout:install
    
  3. Compile Assets (Optional):

    bin/rails assets:precompile
    
  4. Start Server:

    foreman start -f Procfile.dev
    

Installation (For Docker)

  1. Add Gem using docker compose:

    docker compose run web bundle add spree_razorpay_checkout
    
  2. Install the Gem using Docker's Bundle Install:

    docker compose run web bundle exec rails g spree_razorpay_checkout:install
    
  3. Compile Assests for Razorpay logo & assets (Recommended):

    docker compose run web bundle exec rails assets:precompile
    
  4. Re-Start Server (Recommended):

    docker compose down
    docker compose up -d
    

    Upgrade to Latest Version:

  5. Change version in Spree's GemFile:

    gem "spree_razorpay_checkout", "~> 0.1.1"
    
  6. Run Bundle Updator to Patch updated files:

    bundle update
    
  7. Migrate Database Tables (Recommended):

    rails db:migrate
    
  8. Re-Start Server (Recommended):

    bin/rails restart
    

Plugin Configuration

  1. Get keys from Razorpay Dashboard here.

razorpay dashboard

  1. Make Sure to include both Razorpay Live & Test Keys from Razorpay Dashboard:

Admin Dashboard - Razorpay Plugin

  1. Drag Razorpay to Top in Payment Methods to make it Default:

Payment Methods - Razorpay Plugin

Checkout View

  1. Checkout Page:

Razorpay Checkout Page

  1. Razorpay Modal to Capture Payments:

Razorpay Modal

  1. Order Page (Customer View):

Customers Orders Page Razorpay Spree

  1. Order Page (Admin View):

Admin Orders Page Razorpay Spree

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

  1. Uninstall Gem:

    gem uninstall spree_razorpay_checkout
    gem uninstall razorpay
    
  2. Update Gemfile:

    bundle install
    
  3. Remove Migrations:

    rm db/migrate/*_create_spree_razorpay_checkouts.spree_razorpay_checkout.rb
    
  4. Open 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.