class GoCardlessPro::Resources::Event
Events are stored for all webhooks. An event refers to a resource which has been updated, for example a payment which has been collected, or a mandate which has been transferred. Event
creation is an asynchronous process, so it can take some time between an action occurring and its corresponding event getting included in API responses. See [here](event-actions) for a complete list of event types.
Attributes
Public Class Methods
Source
# File lib/gocardless_pro/resources/event.rb, line 25 def initialize(object, response = nil) @object = object @action = object['action'] @created_at = object['created_at'] @customer_notifications = object['customer_notifications'] @details = object['details'] @id = object['id'] @links = object['links'] @metadata = object['metadata'] @resource_metadata = object['resource_metadata'] @resource_type = object['resource_type'] @response = response end
Initialize a event resource instance @param object [Hash] an object returned from the API
Public Instance Methods
Source
# File lib/gocardless_pro/resources/event.rb, line 40 def api_response ApiResponse.new(@response) end
Source
# File lib/gocardless_pro/resources/event.rb, line 45 def links @event_links ||= Links.new(@links) end
Return the links that the resource has
Source
# File lib/gocardless_pro/resources/event.rb, line 50 def to_h @object end
Provides the event resource as a hash of all its readable attributes