Class: CheckoutSdk::Previous::Events::EventsClient

Inherits:
Client
  • Object
show all
Defined in:
lib/checkout_sdk/events/events_client.rb

Instance Attribute Summary

Attributes inherited from Client

#api_client, #authorization_type, #configuration

Instance Method Summary collapse

Constructor Details

#initialize(api_client, configuration) ⇒ EventsClient

Returns a new instance of EventsClient.

Parameters:



17
18
19
# File 'lib/checkout_sdk/events/events_client.rb', line 17

def initialize(api_client, configuration)
  super(api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY)
end

Instance Method Details

#retrieve_all_event_types(version = nil) ⇒ Object

Parameters:

  • version (String, nil) (defaults to: nil)


22
23
24
25
# File 'lib/checkout_sdk/events/events_client.rb', line 22

def retrieve_all_event_types(version = nil)
  query = "version=#{version}" unless version.nil?
  api_client.invoke_get(EVENT_TYPES, sdk_authorization, query)
end

#retrieve_event(event_id) ⇒ Object

Parameters:

  • event_id (String)


33
34
35
# File 'lib/checkout_sdk/events/events_client.rb', line 33

def retrieve_event(event_id)
  api_client.invoke_get(build_path(EVENTS, event_id), sdk_authorization)
end

#retrieve_event_notification(event_id, notification_id) ⇒ Object

Parameters:

  • event_id (String)
  • notification_id (String)


39
40
41
# File 'lib/checkout_sdk/events/events_client.rb', line 39

def retrieve_event_notification(event_id, notification_id)
  api_client.invoke_get(build_path(EVENTS, event_id, NOTIFICATIONS, notification_id), sdk_authorization)
end

#retrieve_events(query_filter) ⇒ Object

Parameters:



28
29
30
# File 'lib/checkout_sdk/events/events_client.rb', line 28

def retrieve_events(query_filter)
  api_client.invoke_get(EVENTS, sdk_authorization, query_filter)
end

#retry_all_webhooks(event_id) ⇒ Object

Parameters:

  • event_id (String)


50
51
52
# File 'lib/checkout_sdk/events/events_client.rb', line 50

def retry_all_webhooks(event_id)
  api_client.invoke_post(build_path(EVENTS, event_id, WEBHOOKS, RETRY), sdk_authorization)
end

#retry_webhook(event_id, webhook_id) ⇒ Object

Parameters:

  • event_id (String)
  • webhook_id (String)


45
46
47
# File 'lib/checkout_sdk/events/events_client.rb', line 45

def retry_webhook(event_id, webhook_id)
  api_client.invoke_post(build_path(EVENTS, event_id, WEBHOOKS, webhook_id), sdk_authorization)
end