Class: K2ConnectRuby::K2Services::Payloads::Transactions::PaymentLink
- Inherits:
-
Object
- Object
- K2ConnectRuby::K2Services::Payloads::Transactions::PaymentLink
- Includes:
- ActiveModel::Validations
- Defined in:
- lib/k2-connect-ruby/k2_services/payloads/transactions/payment_link.rb
Overview
Parsed attributes of payment link result callback
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#callback_url ⇒ Object
readonly
Returns the value of attribute callback_url.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#links_self ⇒ Object
readonly
Returns the value of attribute links_self.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#note ⇒ Object
readonly
Returns the value of attribute note.
-
#payment_link ⇒ Object
readonly
Returns the value of attribute payment_link.
-
#payment_reference ⇒ Object
readonly
Returns the value of attribute payment_reference.
-
#request_errors ⇒ Object
readonly
Returns the value of attribute request_errors.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#till_name ⇒ Object
readonly
Returns the value of attribute till_name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(payload) ⇒ PaymentLink
constructor
A new instance of PaymentLink.
Constructor Details
#initialize(payload) ⇒ PaymentLink
Returns a new instance of PaymentLink.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/payment_link.rb', line 18 def initialize(payload) @id = payload.dig("data", "id") @type = payload.dig("data", "type") @status = payload.dig("data", "attributes", "status") @created_at = payload.dig("data", "attributes", "created_at") @till_name = payload.dig("data", "attributes", "till_name") @currency = payload.dig("data", "attributes", "currency") @amount = payload.dig("data", "attributes", "amount") @payment_reference = payload.dig("data", "attributes", "payment_reference") @note = payload.dig("data", "attributes", "note") @payment_link = payload.dig("data", "attributes", "payment_link")&.deep_symbolize_keys @metadata = payload.dig("data", "attributes", "metadata")&.deep_symbolize_keys @request_errors = payload.dig("data", "attributes", "errors") @callback_url = payload.dig("data", "attributes", "_links", "callback_url") @links_self = payload.dig("data", "attributes", "_links", "self") end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
11 12 13 |
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/payment_link.rb', line 11 def amount @amount end |
#callback_url ⇒ Object (readonly)
Returns the value of attribute callback_url.
11 12 13 |
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/payment_link.rb', line 11 def callback_url @callback_url end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
11 12 13 |
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/payment_link.rb', line 11 def created_at @created_at end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
11 12 13 |
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/payment_link.rb', line 11 def currency @currency end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
11 12 13 |
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/payment_link.rb', line 11 def id @id end |
#links_self ⇒ Object (readonly)
Returns the value of attribute links_self.
11 12 13 |
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/payment_link.rb', line 11 def links_self @links_self end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
11 12 13 |
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/payment_link.rb', line 11 def @metadata end |
#note ⇒ Object (readonly)
Returns the value of attribute note.
11 12 13 |
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/payment_link.rb', line 11 def note @note end |
#payment_link ⇒ Object (readonly)
Returns the value of attribute payment_link.
11 12 13 |
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/payment_link.rb', line 11 def payment_link @payment_link end |
#payment_reference ⇒ Object (readonly)
Returns the value of attribute payment_reference.
11 12 13 |
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/payment_link.rb', line 11 def payment_reference @payment_reference end |
#request_errors ⇒ Object (readonly)
Returns the value of attribute request_errors.
11 12 13 |
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/payment_link.rb', line 11 def request_errors @request_errors end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
11 12 13 |
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/payment_link.rb', line 11 def status @status end |
#till_name ⇒ Object (readonly)
Returns the value of attribute till_name.
11 12 13 |
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/payment_link.rb', line 11 def till_name @till_name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
11 12 13 |
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/payment_link.rb', line 11 def type @type end |