Sha256: 5ba4f67b7cfe4bc983d785584ebed29ba5679054c0b436732de1fe94e6b8cd03
Contents?: true
Size: 834 Bytes
Versions: 1
Compression:
Stored size: 834 Bytes
Contents
require 'razorpay/request' require 'razorpay/refund' require 'razorpay/entity' module Razorpay # Payment class is the most commonly used class # and is used to interact with Payments, the most # common type of transactions class Payment < Entity def self.request Razorpay::Request.new('payments') end def self.fetch(id) request.fetch id end def self.all(options = {}) request.all options end def refund(options = {}) self.class.request.post "#{id}/refund", options end def refunds # This needs to be a string, not a symbol Refund.new('payment_id' => id) end def capture(options) raise ArgumentError, 'Please provide capture amount' unless options.key?(:amount) self.class.request.post "#{id}/capture", options end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
razorpay-1.1.0 | lib/razorpay/payment.rb |