Class: PushPay::Webhook

Inherits:
Base
  • Object
show all
Defined in:
lib/pushpay/webhook.rb

Instance Attribute Summary

Attributes inherited from Base

#client

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from PushPay::Base

Instance Method Details

#create(params, merchant_key: nil) ⇒ Object

Create a webhook



16
17
18
# File 'lib/pushpay/webhook.rb', line 16

def create(params, merchant_key: nil)
  client.post("#{merchant_path(merchant_key)}/webhooks", params)
end

#delete(webhook_token, merchant_key: nil) ⇒ Object

Delete a webhook



26
27
28
# File 'lib/pushpay/webhook.rb', line 26

def delete(webhook_token, merchant_key: nil)
  client.delete("#{merchant_path(merchant_key)}/webhook/#{webhook_token}")
end

#find(webhook_token, merchant_key: nil) ⇒ Object

Get a specific webhook



6
7
8
# File 'lib/pushpay/webhook.rb', line 6

def find(webhook_token, merchant_key: nil)
  client.get("#{merchant_path(merchant_key)}/webhook/#{webhook_token}")
end

#list(merchant_key: nil, **params) ⇒ Object

List webhooks for a merchant



11
12
13
# File 'lib/pushpay/webhook.rb', line 11

def list(merchant_key: nil, **params)
  client.get("#{merchant_path(merchant_key)}/webhooks", params)
end

#update(webhook_token, params, merchant_key: nil) ⇒ Object

Update a webhook



21
22
23
# File 'lib/pushpay/webhook.rb', line 21

def update(webhook_token, params, merchant_key: nil)
  client.put("#{merchant_path(merchant_key)}/webhook/#{webhook_token}", params)
end