Class: Revolut::Webhook

Inherits:
Resource show all
Defined in:
lib/revolut/resources/webhook.rb

Overview

Class Method Summary collapse

Methods inherited from Resource

coerce_with, create, delete, #initialize, list, retrieve, skip_coertion_for, #to_json, to_proc, update

Constructor Details

This class inherits a constructor from Revolut::Resource

Class Method Details

.failed_events(id) ⇒ Object



19
20
21
22
23
# File 'lib/revolut/resources/webhook.rb', line 19

def failed_events(id)
  response = http_client.get("/#{resources_name}/#{id}/failed-events")

  response.body.map(&Revolut::WebhookEvent)
end

.http_clientObject



9
10
11
# File 'lib/revolut/resources/webhook.rb', line 9

def http_client
  @http_client ||= Revolut::Client.new(api_version: "2.0")
end

.resources_nameObject



5
6
7
# File 'lib/revolut/resources/webhook.rb', line 5

def resources_name
  "webhooks"
end

.rotate_signing_secret(id, **data) ⇒ Object



13
14
15
16
17
# File 'lib/revolut/resources/webhook.rb', line 13

def rotate_signing_secret(id, **data)
  response = http_client.post("/#{resources_name}/#{id}/rotate-signing-secret", data:)

  new(response.body)
end