Class: GoCardlessPro::Resources::Event
- Inherits:
-
Object
- Object
- GoCardlessPro::Resources::Event
- Defined in:
- lib/gocardless_pro/resources/event.rb
Overview
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 (https://developer.gocardless.com/api-reference/#event-types) for a complete list of event types.
Important: Events older than 18 months will be archived and no longer accessible via the API or exports. Archival will begin no sooner than 1 August 2026 in sandbox environments, and no sooner than 1 October 2026 in live environments. Events within the 18-month window are unaffected. If you need archived data, contact GoCardless support.
Defined Under Namespace
Classes: Links
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#customer_notifications ⇒ Object
readonly
Returns the value of attribute customer_notifications.
-
#details ⇒ Object
readonly
Returns the value of attribute details.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#resource_metadata ⇒ Object
readonly
Returns the value of attribute resource_metadata.
-
#resource_type ⇒ Object
readonly
Returns the value of attribute resource_type.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
- #api_response ⇒ Object
-
#initialize(object, response = nil) ⇒ Event
constructor
Initialize a event resource instance.
-
#links ⇒ Object
Return the links that the resource has.
-
#to_h ⇒ Object
Provides the event resource as a hash of all its readable attributes.
Constructor Details
#initialize(object, response = nil) ⇒ Event
Initialize a event resource instance
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/gocardless_pro/resources/event.rb', line 39 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'] @source = object['source'] @response = response end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
27 28 29 |
# File 'lib/gocardless_pro/resources/event.rb', line 27 def action @action end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
28 29 30 |
# File 'lib/gocardless_pro/resources/event.rb', line 28 def created_at @created_at end |
#customer_notifications ⇒ Object (readonly)
Returns the value of attribute customer_notifications.
29 30 31 |
# File 'lib/gocardless_pro/resources/event.rb', line 29 def customer_notifications @customer_notifications end |
#details ⇒ Object (readonly)
Returns the value of attribute details.
30 31 32 |
# File 'lib/gocardless_pro/resources/event.rb', line 30 def details @details end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
31 32 33 |
# File 'lib/gocardless_pro/resources/event.rb', line 31 def id @id end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
32 33 34 |
# File 'lib/gocardless_pro/resources/event.rb', line 32 def @metadata end |
#resource_metadata ⇒ Object (readonly)
Returns the value of attribute resource_metadata.
33 34 35 |
# File 'lib/gocardless_pro/resources/event.rb', line 33 def @resource_metadata end |
#resource_type ⇒ Object (readonly)
Returns the value of attribute resource_type.
34 35 36 |
# File 'lib/gocardless_pro/resources/event.rb', line 34 def resource_type @resource_type end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
35 36 37 |
# File 'lib/gocardless_pro/resources/event.rb', line 35 def source @source end |
Instance Method Details
#api_response ⇒ Object
55 56 57 |
# File 'lib/gocardless_pro/resources/event.rb', line 55 def api_response ApiResponse.new(@response) end |
#links ⇒ Object
Return the links that the resource has
60 61 62 |
# File 'lib/gocardless_pro/resources/event.rb', line 60 def links @event_links ||= Links.new(@links) end |
#to_h ⇒ Object
Provides the event resource as a hash of all its readable attributes
65 66 67 |
# File 'lib/gocardless_pro/resources/event.rb', line 65 def to_h @object end |