Class: PushPay::Webhook
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#create(params, merchant_key: nil) ⇒ Object
Create a webhook.
-
#delete(webhook_token, merchant_key: nil) ⇒ Object
Delete a webhook.
-
#find(webhook_token, merchant_key: nil) ⇒ Object
Get a specific webhook.
-
#list(merchant_key: nil, **params) ⇒ Object
List webhooks for a merchant.
-
#update(webhook_token, params, merchant_key: nil) ⇒ Object
Update a webhook.
Methods inherited from Base
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 |