Skip to content

umeshravani/spree_razorpay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

120 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

razorpay

This Razorpay Checkout Reprository is mentioned in official Spree Commerce Docs.

Razorpay Extension for Spree Commerce v5.3+

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

Render Widget in Product Details:

  1. Find your Partial file Example:

    'app/views/themes/default/spree/page_sections/_product_details.html.erb'
    

    Note: If you dont find this file inside your spree's directory, You can Download this directly from Spree's Github and place it exactly inside your Spree's directory

  2. Place this Rendering Code:

     <% when 'Spree::PageBlocks::Products::RazorpayAffordability' %>
     <%# We call your custom render method defined in the model %>
     <%= block.render(self, product: product) %>
    

    Exactly below this part:

    <% when 'Spree::PageBlocks::Products::Description' %>
    

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:

  1. Change version in Spree's GemFile:

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

    bundle update
  3. Migrate Database Tables (Recommended):

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

    bin/rails restart

Plugin Configuration

  1. Get keys from Razorpay Dashboard here.

    razorpay dashboard
  2. 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:

     ActiveRecord::Base.connection.drop_table(:spree_razorpay_checkouts)
  6. 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.

About

RazorPay Integration for Spree Commerce 5.3 - the only payments solution in India that allows businesses to accept, process and disburse payments with its product suite.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors