Class: K2ConnectRuby::K2Services::Payloads::DarajaWebhooks
- Inherits:
-
Object
- Object
- K2ConnectRuby::K2Services::Payloads::DarajaWebhooks
- Includes:
- ActiveModel::Validations
- Defined in:
- lib/k2-connect-ruby/k2_services/payloads/daraja_webhooks.rb
Instance Attribute Summary collapse
-
#bill_ref_number ⇒ Object
readonly
Returns the value of attribute bill_ref_number.
-
#business_short_code ⇒ Object
readonly
Returns the value of attribute business_short_code.
-
#first_name ⇒ Object
readonly
Returns the value of attribute first_name.
-
#invoice_number ⇒ Object
readonly
Returns the value of attribute invoice_number.
-
#last_name ⇒ Object
readonly
Returns the value of attribute last_name.
-
#middle_name ⇒ Object
readonly
Returns the value of attribute middle_name.
-
#msisdn ⇒ Object
readonly
Returns the value of attribute msisdn.
-
#org_account_balance ⇒ Object
readonly
Returns the value of attribute org_account_balance.
-
#third_party_transaction_id ⇒ Object
readonly
Returns the value of attribute third_party_transaction_id.
-
#transaction_amount ⇒ Object
readonly
Returns the value of attribute transaction_amount.
-
#transaction_id ⇒ Object
readonly
Returns the value of attribute transaction_id.
-
#transaction_time ⇒ Object
readonly
Returns the value of attribute transaction_time.
-
#transaction_type ⇒ Object
readonly
Returns the value of attribute transaction_type.
Instance Method Summary collapse
-
#initialize(payload) ⇒ DarajaWebhooks
constructor
A new instance of DarajaWebhooks.
Constructor Details
#initialize(payload) ⇒ DarajaWebhooks
Returns a new instance of DarajaWebhooks.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/k2-connect-ruby/k2_services/payloads/daraja_webhooks.rb', line 25 def initialize(payload) @transaction_type = payload.dig("TransactionType") @transaction_id = payload.dig("TransID") @transaction_time = payload.dig("TransTime") @transaction_amount = payload.dig("TransAmount") @business_short_code = payload.dig("BusinessShortCode") @bill_ref_number = payload.dig("BillRefNumber") @invoice_number = payload.dig("InvoiceNumber") @org_account_balance = payload.dig("OrgAccountBalance") @third_party_transaction_id = payload.dig("ThirdPartyTransId") @msisdn = payload.dig("MSISDN") @first_name = payload.dig("FirstName") @middle_name = payload.dig("MiddleName") @last_name = payload.dig("LastName") end |
Instance Attribute Details
#bill_ref_number ⇒ Object (readonly)
Returns the value of attribute bill_ref_number.
9 10 11 |
# File 'lib/k2-connect-ruby/k2_services/payloads/daraja_webhooks.rb', line 9 def bill_ref_number @bill_ref_number end |
#business_short_code ⇒ Object (readonly)
Returns the value of attribute business_short_code.
9 10 11 |
# File 'lib/k2-connect-ruby/k2_services/payloads/daraja_webhooks.rb', line 9 def business_short_code @business_short_code end |
#first_name ⇒ Object (readonly)
Returns the value of attribute first_name.
9 10 11 |
# File 'lib/k2-connect-ruby/k2_services/payloads/daraja_webhooks.rb', line 9 def first_name @first_name end |
#invoice_number ⇒ Object (readonly)
Returns the value of attribute invoice_number.
9 10 11 |
# File 'lib/k2-connect-ruby/k2_services/payloads/daraja_webhooks.rb', line 9 def invoice_number @invoice_number end |
#last_name ⇒ Object (readonly)
Returns the value of attribute last_name.
9 10 11 |
# File 'lib/k2-connect-ruby/k2_services/payloads/daraja_webhooks.rb', line 9 def last_name @last_name end |
#middle_name ⇒ Object (readonly)
Returns the value of attribute middle_name.
9 10 11 |
# File 'lib/k2-connect-ruby/k2_services/payloads/daraja_webhooks.rb', line 9 def middle_name @middle_name end |
#msisdn ⇒ Object (readonly)
Returns the value of attribute msisdn.
9 10 11 |
# File 'lib/k2-connect-ruby/k2_services/payloads/daraja_webhooks.rb', line 9 def msisdn @msisdn end |
#org_account_balance ⇒ Object (readonly)
Returns the value of attribute org_account_balance.
9 10 11 |
# File 'lib/k2-connect-ruby/k2_services/payloads/daraja_webhooks.rb', line 9 def org_account_balance @org_account_balance end |
#third_party_transaction_id ⇒ Object (readonly)
Returns the value of attribute third_party_transaction_id.
9 10 11 |
# File 'lib/k2-connect-ruby/k2_services/payloads/daraja_webhooks.rb', line 9 def third_party_transaction_id @third_party_transaction_id end |
#transaction_amount ⇒ Object (readonly)
Returns the value of attribute transaction_amount.
9 10 11 |
# File 'lib/k2-connect-ruby/k2_services/payloads/daraja_webhooks.rb', line 9 def transaction_amount @transaction_amount end |
#transaction_id ⇒ Object (readonly)
Returns the value of attribute transaction_id.
9 10 11 |
# File 'lib/k2-connect-ruby/k2_services/payloads/daraja_webhooks.rb', line 9 def transaction_id @transaction_id end |
#transaction_time ⇒ Object (readonly)
Returns the value of attribute transaction_time.
9 10 11 |
# File 'lib/k2-connect-ruby/k2_services/payloads/daraja_webhooks.rb', line 9 def transaction_time @transaction_time end |
#transaction_type ⇒ Object (readonly)
Returns the value of attribute transaction_type.
9 10 11 |
# File 'lib/k2-connect-ruby/k2_services/payloads/daraja_webhooks.rb', line 9 def transaction_type @transaction_type end |