Class: K2ConnectRuby::K2Entity::K2FinancialEntities::Destination::ExternalMpesaWallet
- Inherits:
-
DestinationRequest
- Object
- DestinationRequest
- K2ConnectRuby::K2Entity::K2FinancialEntities::Destination::ExternalMpesaWallet
- Includes:
- ActiveModel::Validations
- Defined in:
- lib/k2-connect-ruby/k2_entity/k2_financial_entities/destination/external_mpesa_wallet.rb
Instance Attribute Summary collapse
-
#network ⇒ Object
Returns the value of attribute network.
-
#phone_number ⇒ Object
Returns the value of attribute phone_number.
Attributes inherited from DestinationRequest
#amount, #description, #favourite, #nickname, #type
Instance Method Summary collapse
Methods inherited from DestinationRequest
Constructor Details
This class inherits a constructor from K2ConnectRuby::K2Entity::K2FinancialEntities::Destination::DestinationRequest
Instance Attribute Details
#network ⇒ Object
Returns the value of attribute network.
12 13 14 |
# File 'lib/k2-connect-ruby/k2_entity/k2_financial_entities/destination/external_mpesa_wallet.rb', line 12 def network @network end |
#phone_number ⇒ Object
Returns the value of attribute phone_number.
12 13 14 |
# File 'lib/k2-connect-ruby/k2_entity/k2_financial_entities/destination/external_mpesa_wallet.rb', line 12 def phone_number @phone_number end |
Instance Method Details
#destination_payload ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/k2-connect-ruby/k2_entity/k2_financial_entities/destination/external_mpesa_wallet.rb', line 17 def destination_payload { type: type, nickname: nickname, phone_number: phone_number, network: network, amount: amount, description: description, favourite: ActiveModel::Type::Boolean.new.cast(favourite), } end |
#phone_number_format ⇒ Object
29 30 31 32 33 |
# File 'lib/k2-connect-ruby/k2_entity/k2_financial_entities/destination/external_mpesa_wallet.rb', line 29 def phone_number_format unless phone_number&.match?(/^(254\d{9})$/) errors.add(:phone_number, "#{phone_number} has an invalid length or format. Must be 254XXXXXXXXX.") end end |