Skip to content

devathon/razorpay-rails-sample-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Razorpay Rails Sample App

Rails sample app for integrating Razorpay API. Here is the demo, this app make use of ruby gem razorpay-ruby

Checkout form

We can make the payment by two ways, either using simple form or javascript. see docs

or see here /app/views/products/index.html.erb

Payment Handling at backend

  • Fetch

    Razorpay::Payment.fetch(payment_id)
    
  • Capture

    Razorpay::Payment.fetch(payment_id).capture
    Razorpay::Payment.fetch(payment_id).capture({amount: product_price})
    
  • Refund

    Razorpay::Payment.fetch(payment_id).refund
    Razorpay::Payment.fetch(payment_id).refund({amount: refund_amount})
    
  • Refunds

    Razorpay::Payment.fetch(payment_id).refunds.all
    Razorpay::Payment.fetch(payment_id).refunds.all({from:Timestamp,to:Timestamp,count:2,skip:1})
    

You can checkout all entities returned by the Razorpay here

Source

The reference used for this app docs.razorpay.com/v1/docs, github.com/razorpay/razorpay-ruby