Class: IncomingPayments
- Inherits:
-
CommonPayment
- Object
- K2Transaction
- CommonPayment
- IncomingPayments
- 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.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#event ⇒ Object
readonly
Returns the value of attribute event.
-
#event_type ⇒ Object
readonly
Returns the value of attribute event_type.
-
#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) ⇒ IncomingPayments
constructor
A new instance of IncomingPayments.
Constructor Details
#initialize(payload) ⇒ IncomingPayments
Returns a new instance of IncomingPayments.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/incoming_payment.rb', line 18 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 @errors = payload.dig('data', 'attributes', 'event', 'errors') end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
2 3 4 |
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/incoming_payment.rb', line 2 def amount @amount end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
2 3 4 |
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/incoming_payment.rb', line 2 def currency @currency end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
2 3 4 |
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/incoming_payment.rb', line 2 def errors @errors end |
#event ⇒ Object (readonly)
Returns the value of attribute event.
2 3 4 |
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/incoming_payment.rb', line 2 def event @event end |
#event_type ⇒ Object (readonly)
Returns the value of attribute event_type.
2 3 4 |
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/incoming_payment.rb', line 2 def event_type @event_type end |
#origination_time ⇒ Object (readonly)
Returns the value of attribute origination_time.
2 3 4 |
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/incoming_payment.rb', line 2 def origination_time @origination_time end |
#resource_id ⇒ Object (readonly)
Returns the value of attribute resource_id.
2 3 4 |
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/incoming_payment.rb', line 2 def resource_id @resource_id end |
#resource_status ⇒ Object (readonly)
Returns the value of attribute resource_status.
2 3 4 |
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/incoming_payment.rb', line 2 def resource_status @resource_status end |
#sender_first_name ⇒ Object (readonly)
Returns the value of attribute sender_first_name.
2 3 4 |
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/incoming_payment.rb', line 2 def sender_first_name @sender_first_name end |
#sender_last_name ⇒ Object (readonly)
Returns the value of attribute sender_last_name.
2 3 4 |
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/incoming_payment.rb', line 2 def sender_last_name @sender_last_name end |
#sender_middle_name ⇒ Object (readonly)
Returns the value of attribute sender_middle_name.
2 3 4 |
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/incoming_payment.rb', line 2 def sender_middle_name @sender_middle_name end |
#sender_phone_number ⇒ Object (readonly)
Returns the value of attribute sender_phone_number.
2 3 4 |
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/incoming_payment.rb', line 2 def sender_phone_number @sender_phone_number end |
#system ⇒ Object (readonly)
Returns the value of attribute system.
2 3 4 |
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/incoming_payment.rb', line 2 def system @system end |
#till_number ⇒ Object (readonly)
Returns the value of attribute till_number.
2 3 4 |
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/incoming_payment.rb', line 2 def till_number @till_number end |
#transaction_reference ⇒ Object (readonly)
Returns the value of attribute transaction_reference.
2 3 4 |
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/incoming_payment.rb', line 2 def transaction_reference @transaction_reference end |