Class: Razorpay::Webhook

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

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

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

.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 = {},  = nil)
  if()
   return request.get "#{}/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,  = nil)
  if()
   return request.post "#{}/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, )
  request.delete "#{}/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,  = nil)
  if()  
   return request.patch "#{}/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, )
  request.fetch "#{}/webhooks/#{id}", @@versions
end

.requestObject



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

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