Class: Razorpay::Account

Inherits:
Entity
  • Object
show all
Defined in:
lib/razorpay/account.rb

Overview

Account API allows you to create a sub-merchant account.

Constant Summary collapse

@@versions =
"v2"

Instance Attribute Summary

Attributes inherited from Entity

#attributes

Class Method Summary collapse

Methods inherited from Entity

#initialize, #method_missing, #respond_to_missing?, #to_json, #with_a_bang

Constructor Details

This class inherits a constructor from Razorpay::Entity

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Razorpay::Entity

Class Method Details

.create(options) ⇒ Object



14
15
16
# File 'lib/razorpay/account.rb', line 14

def self.create(options)
  request.create options, @@versions
end

.delete(id) ⇒ Object



26
27
28
# File 'lib/razorpay/account.rb', line 26

def self.delete(id)
  request.delete "#{id}", @@versions
end

.edit(id, options = {}) ⇒ Object



22
23
24
# File 'lib/razorpay/account.rb', line 22

def self.edit(id, options = {})
  request.patch id, options, @@versions
end

.fetch(id) ⇒ Object



18
19
20
# File 'lib/razorpay/account.rb', line 18

def self.fetch(id)
  request.fetch id, @@versions
end

.fetch_account_doc(id) ⇒ Object



35
36
37
# File 'lib/razorpay/account.rb', line 35

def self.(id)
  request.fetch "#{id}/documents", @@versions
end

.requestObject



10
11
12
# File 'lib/razorpay/account.rb', line 10

def self.request
  Razorpay::Request.new('accounts')
end

.upload_account_doc(id, options) ⇒ Object



30
31
32
33
# File 'lib/razorpay/account.rb', line 30

def self.(id,options)
  r = request
  r.request :post, "/#{@@versions}/accounts/#{id}/documents", options
end