Class: K2ConnectRuby::K2Services::Payloads::Transactions::IncomingPayment
- Inherits:
-
CommonPayment
- Object
- K2Transaction
- CommonPayment
- K2ConnectRuby::K2Services::Payloads::Transactions::IncomingPayment
- Defined in:
- lib/k2-connect-ruby/k2_services/payloads/transactions/incoming_payment.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#event ⇒ Object
readonly
Returns the value of attribute event.
-
#event_type ⇒ Object
readonly
Returns the value of attribute event_type.
-
#k2_errors ⇒ Object
readonly
Returns the value of attribute k2_errors.
-
#origination_time ⇒ Object
readonly
Returns the value of attribute origination_time.
-
#resource_id ⇒ Object
readonly
Returns the value of attribute resource_id.
-
#resource_status ⇒ Object
readonly
Returns the value of attribute resource_status.
-
#sender_first_name ⇒ Object
readonly
Returns the value of attribute sender_first_name.
-
#sender_last_name ⇒ Object
readonly
Returns the value of attribute sender_last_name.
-
#sender_middle_name ⇒ Object
readonly
Returns the value of attribute sender_middle_name.
-
#sender_phone_number ⇒ Object
readonly
Returns the value of attribute sender_phone_number.
-
#system ⇒ Object
readonly
Returns the value of attribute system.
-
#till_number ⇒ Object
readonly
Returns the value of attribute till_number.
-
#transaction_reference ⇒ Object
readonly
Returns the value of attribute transaction_reference.
Attributes inherited from CommonPayment
Attributes inherited from K2Transaction
#callback_url, #id, #links_self, #metadata, #type
Instance Method Summary collapse
-
#initialize(payload) ⇒ IncomingPayment
constructor
A new instance of IncomingPayment.
Constructor Details
#initialize(payload) ⇒ IncomingPayment
Returns a new instance of IncomingPayment.
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/incoming_payment.rb', line 24 def initialize(payload) super # Event details @event = payload.dig("data", "attributes", "event") @event_type = payload.dig("data", "attributes", "event", "type") # Resource details @resource_id = payload.dig("data", "attributes", "event", "resource", "id") @transaction_reference = payload.dig("data", "attributes", "event", "resource", "reference") @origination_time = payload.dig("data", "attributes", "event", "resource", "origination_time") @sender_phone_number = payload.dig("data", "attributes", "event", "resource", "sender_phone_number") @amount = payload.dig("data", "attributes", "event", "resource", "amount") @currency = payload.dig("data", "attributes", "event", "resource", "currency") @till_number = payload.dig("data", "attributes", "event", "resource", "till_number") @system = payload.dig("data", "attributes", "event", "resource", "system") @resource_status = payload.dig("data", "attributes", "event", "resource", "status") @sender_first_name = payload.dig("data", "attributes", "event", "resource", "sender_first_name") @sender_middle_name = payload.dig("data", "attributes", "event", "resource", "sender_middle_name") @sender_last_name = payload.dig("data", "attributes", "event", "resource", "sender_last_name") # Errors @k2_errors = payload.dig("data", "attributes", "event", "errors") end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
8 9 10 |
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/incoming_payment.rb', line 8 def amount @amount end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
8 9 10 |
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/incoming_payment.rb', line 8 def currency @currency end |
#event ⇒ Object (readonly)
Returns the value of attribute event.
8 9 10 |
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/incoming_payment.rb', line 8 def event @event end |
#event_type ⇒ Object (readonly)
Returns the value of attribute event_type.
8 9 10 |
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/incoming_payment.rb', line 8 def event_type @event_type end |
#k2_errors ⇒ Object (readonly)
Returns the value of attribute k2_errors.
8 9 10 |
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/incoming_payment.rb', line 8 def k2_errors @k2_errors end |
#origination_time ⇒ Object (readonly)
Returns the value of attribute origination_time.
8 9 10 |
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/incoming_payment.rb', line 8 def origination_time @origination_time end |
#resource_id ⇒ Object (readonly)
Returns the value of attribute resource_id.
8 9 10 |
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/incoming_payment.rb', line 8 def resource_id @resource_id end |
#resource_status ⇒ Object (readonly)
Returns the value of attribute resource_status.
8 9 10 |
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/incoming_payment.rb', line 8 def resource_status @resource_status end |
#sender_first_name ⇒ Object (readonly)
Returns the value of attribute sender_first_name.
8 9 10 |
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/incoming_payment.rb', line 8 def sender_first_name @sender_first_name end |
#sender_last_name ⇒ Object (readonly)
Returns the value of attribute sender_last_name.
8 9 10 |
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/incoming_payment.rb', line 8 def sender_last_name @sender_last_name end |
#sender_middle_name ⇒ Object (readonly)
Returns the value of attribute sender_middle_name.
8 9 10 |
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/incoming_payment.rb', line 8 def sender_middle_name @sender_middle_name end |
#sender_phone_number ⇒ Object (readonly)
Returns the value of attribute sender_phone_number.
8 9 10 |
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/incoming_payment.rb', line 8 def sender_phone_number @sender_phone_number end |
#system ⇒ Object (readonly)
Returns the value of attribute system.
8 9 10 |
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/incoming_payment.rb', line 8 def system @system end |
#till_number ⇒ Object (readonly)
Returns the value of attribute till_number.
8 9 10 |
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/incoming_payment.rb', line 8 def till_number @till_number end |
#transaction_reference ⇒ Object (readonly)
Returns the value of attribute transaction_reference.
8 9 10 |
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/incoming_payment.rb', line 8 def transaction_reference @transaction_reference end |