Class: Razorpay::Webhook
Overview
Webhook API allows you create, fetch, update and delete
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
.all(options = {}, account_id = nil) ⇒ Object
23
24
25
26
27
28
29
30
|
# File 'lib/razorpay/webhook.rb', line 23
def self.all(options = {}, account_id = nil)
if(account_id)
return request.get "#{account_id}/webhooks" , options , @@versions
end
r = request
return r.request :get, "/v1/webhooks", options
end
|
.create(options, account_id = nil) ⇒ Object
14
15
16
17
18
19
20
21
|
# File 'lib/razorpay/webhook.rb', line 14
def self.create(options, account_id = nil)
if(account_id)
return request.post "#{account_id}/webhooks", options, @@versions
end
r = request
return r.request :post, "/v1/webhooks", options
end
|
.delete(id, account_id) ⇒ Object
45
46
47
|
# File 'lib/razorpay/webhook.rb', line 45
def self.delete(id, account_id)
request.delete "#{account_id}/webhooks/#{id}", @@versions
end
|
.edit(options, id, account_id = nil) ⇒ Object
36
37
38
39
40
41
42
43
|
# File 'lib/razorpay/webhook.rb', line 36
def self.edit(options, id, account_id = nil)
if(account_id)
return request.patch "#{account_id}/webhooks/#{id}", options, @@versions
end
r = request
return r.request :put, "/v1/webhooks/#{id}" , options
end
|
.fetch(id, account_id) ⇒ Object
32
33
34
|
# File 'lib/razorpay/webhook.rb', line 32
def self.fetch(id, account_id)
request.fetch "#{account_id}/webhooks/#{id}", @@versions
end
|
.request ⇒ Object
10
11
12
|
# File 'lib/razorpay/webhook.rb', line 10
def self.request
Razorpay::Request.new('accounts')
end
|