Class: K2ConnectRuby::K2Entity::K2FinancialEntities::StkPush::StkPushRequest
- Inherits:
-
Object
- Object
- K2ConnectRuby::K2Entity::K2FinancialEntities::StkPush::StkPushRequest
- Includes:
- ActiveModel::Validations
- Defined in:
- lib/k2-connect-ruby/k2_entity/k2_financial_entities/stk_push/stk_push_request.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#callback_url ⇒ Object
Returns the value of attribute callback_url.
-
#email ⇒ Object
Returns the value of attribute email.
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#middle_name ⇒ Object
Returns the value of attribute middle_name.
-
#payment_channel ⇒ Object
Returns the value of attribute payment_channel.
-
#phone_number ⇒ Object
Returns the value of attribute phone_number.
-
#till_number ⇒ Object
Returns the value of attribute till_number.
Instance Method Summary collapse
- #endpoint ⇒ Object
-
#initialize(kwargs) ⇒ StkPushRequest
constructor
A new instance of StkPushRequest.
- #request_body ⇒ Object
Constructor Details
#initialize(kwargs) ⇒ StkPushRequest
Returns a new instance of StkPushRequest.
16 17 18 19 20 |
# File 'lib/k2-connect-ruby/k2_entity/k2_financial_entities/stk_push/stk_push_request.rb', line 16 def initialize(kwargs) kwargs.each do |key, value| instance_variable_set("@#{key}", value) end end |
Instance Attribute Details
#amount ⇒ Object
Returns the value of attribute amount.
10 11 12 |
# File 'lib/k2-connect-ruby/k2_entity/k2_financial_entities/stk_push/stk_push_request.rb', line 10 def amount @amount end |
#callback_url ⇒ Object
Returns the value of attribute callback_url.
10 11 12 |
# File 'lib/k2-connect-ruby/k2_entity/k2_financial_entities/stk_push/stk_push_request.rb', line 10 def callback_url @callback_url end |
#email ⇒ Object
Returns the value of attribute email.
10 11 12 |
# File 'lib/k2-connect-ruby/k2_entity/k2_financial_entities/stk_push/stk_push_request.rb', line 10 def email @email end |
#first_name ⇒ Object
Returns the value of attribute first_name.
10 11 12 |
# File 'lib/k2-connect-ruby/k2_entity/k2_financial_entities/stk_push/stk_push_request.rb', line 10 def first_name @first_name end |
#last_name ⇒ Object
Returns the value of attribute last_name.
10 11 12 |
# File 'lib/k2-connect-ruby/k2_entity/k2_financial_entities/stk_push/stk_push_request.rb', line 10 def last_name @last_name end |
#metadata ⇒ Object
Returns the value of attribute metadata.
10 11 12 |
# File 'lib/k2-connect-ruby/k2_entity/k2_financial_entities/stk_push/stk_push_request.rb', line 10 def @metadata end |
#middle_name ⇒ Object
Returns the value of attribute middle_name.
10 11 12 |
# File 'lib/k2-connect-ruby/k2_entity/k2_financial_entities/stk_push/stk_push_request.rb', line 10 def middle_name @middle_name end |
#payment_channel ⇒ Object
Returns the value of attribute payment_channel.
10 11 12 |
# File 'lib/k2-connect-ruby/k2_entity/k2_financial_entities/stk_push/stk_push_request.rb', line 10 def payment_channel @payment_channel end |
#phone_number ⇒ Object
Returns the value of attribute phone_number.
10 11 12 |
# File 'lib/k2-connect-ruby/k2_entity/k2_financial_entities/stk_push/stk_push_request.rb', line 10 def phone_number @phone_number end |
#till_number ⇒ Object
Returns the value of attribute till_number.
10 11 12 |
# File 'lib/k2-connect-ruby/k2_entity/k2_financial_entities/stk_push/stk_push_request.rb', line 10 def till_number @till_number end |
Instance Method Details
#endpoint ⇒ Object
22 23 24 |
# File 'lib/k2-connect-ruby/k2_entity/k2_financial_entities/stk_push/stk_push_request.rb', line 22 def endpoint K2ConnectRuby::K2Utilities::Config::K2Config.endpoint("incoming_payments") end |
#request_body ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/k2-connect-ruby/k2_entity/k2_financial_entities/stk_push/stk_push_request.rb', line 26 def request_body { payment_channel: payment_channel, till_number: till_number, subscriber: { first_name: first_name, middle_name: middle_name, last_name: last_name, phone_number: phone_number, email: email, }, amount: { currency: "KES", value: amount, }, metadata: , _links: { callback_url: callback_url, }, } end |