Class: K2ConnectRuby::K2Services::Payloads::K2CommonEvents
- Inherits:
-
K2Webhooks
- Object
- K2Webhooks
- K2ConnectRuby::K2Services::Payloads::K2CommonEvents
- Defined in:
- lib/k2-connect-ruby/k2_services/payloads/k2_webhooks.rb
Direct Known Subclasses
Buygoods, Webhooks::B2bTransactionReceived, Webhooks::B2bTransactionReversed, Webhooks::CardTransactionReceived, Webhooks::CardTransactionReversed, Webhooks::CardTransactionVoided, Webhooks::TransferWebhook
Constant Summary collapse
- REFERENCE_EXCEPTIONS =
["Merchant to Merchant Transaction", "Settlement Transfer"]
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#origination_time ⇒ Object
readonly
Returns the value of attribute origination_time.
-
#reference ⇒ Object
readonly
Returns the value of attribute reference.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Attributes inherited from K2Webhooks
#created_at, #event_resource, #event_type, #id, #links_resource, #links_self, #resource_id, #topic
Instance Method Summary collapse
-
#initialize(payload) ⇒ K2CommonEvents
constructor
A new instance of K2CommonEvents.
Constructor Details
#initialize(payload) ⇒ K2CommonEvents
Returns a new instance of K2CommonEvents.
38 39 40 41 42 43 44 45 |
# File 'lib/k2-connect-ruby/k2_services/payloads/k2_webhooks.rb', line 38 def initialize(payload) super @reference = payload.dig("event", "resource", "reference") unless REFERENCE_EXCEPTIONS.include?(@event_type) @origination_time = payload.dig("event", "resource", "origination_time") @amount = payload.dig("event", "resource", "amount") @currency = payload.dig("event", "resource", "currency") @status = payload.dig("event", "resource", "status") end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
32 33 34 |
# File 'lib/k2-connect-ruby/k2_services/payloads/k2_webhooks.rb', line 32 def amount @amount end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
32 33 34 |
# File 'lib/k2-connect-ruby/k2_services/payloads/k2_webhooks.rb', line 32 def currency @currency end |
#origination_time ⇒ Object (readonly)
Returns the value of attribute origination_time.
32 33 34 |
# File 'lib/k2-connect-ruby/k2_services/payloads/k2_webhooks.rb', line 32 def origination_time @origination_time end |
#reference ⇒ Object (readonly)
Returns the value of attribute reference.
32 33 34 |
# File 'lib/k2-connect-ruby/k2_services/payloads/k2_webhooks.rb', line 32 def reference @reference end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
32 33 34 |
# File 'lib/k2-connect-ruby/k2_services/payloads/k2_webhooks.rb', line 32 def status @status end |