Class: Razorpay::Product
Overview
Product API allows you to enable sub-merchants request for a product.
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
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Razorpay::Entity
Class Method Details
.edit(account_id, id, options = {}) ⇒ Object
25
26
27
28
29
30
|
# File 'lib/razorpay/product.rb', line 25
def self.edit(account_id, id, options = {})
if(!options.is_a?(String) && options.key?(:tnc_accepted))
options[:tnc_accepted] = (options[:tnc_accepted] ? 1 : 0)
end
request.patch "#{account_id}/products/#{id}", options, @@versions
end
|
.fetch(account_id, id) ⇒ Object
21
22
23
|
# File 'lib/razorpay/product.rb', line 21
def self.fetch(account_id, id)
request.fetch "#{account_id}/products/#{id}", @@versions
end
|
.fetch_tnc(productName) ⇒ Object
32
33
34
35
|
# File 'lib/razorpay/product.rb', line 32
def self.fetch_tnc(productName)
r = request
r.request :get, "/#{@@versions}/products/#{productName}/tnc", {}
end
|
.request ⇒ Object
10
11
12
|
# File 'lib/razorpay/product.rb', line 10
def self.request
Razorpay::Request.new('accounts')
end
|
.request_product_configuration(account_id, options) ⇒ Object
14
15
16
17
18
19
|
# File 'lib/razorpay/product.rb', line 14
def self.request_product_configuration(account_id, options)
if(!options.is_a?(String) && options.key?(:tnc_accepted))
options[:tnc_accepted] = (options[:tnc_accepted] ? 1 : 0)
end
request.post "#{account_id}/products", options, @@versions
end
|