Class: K2ConnectRuby::K2Services::Payloads::DarajaWebhooks

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Validations
Defined in:
lib/k2-connect-ruby/k2_services/payloads/daraja_webhooks.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_numberObject (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_codeObject (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_nameObject (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_numberObject (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_nameObject (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_nameObject (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

#msisdnObject (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_balanceObject (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
end

#third_party_transaction_idObject (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_amountObject (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_idObject (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_timeObject (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_typeObject (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