class Mpesa::Payout

Constants

PATH

Public Instance Methods

body() click to toggle source
# File lib/mpesa/resources/payout.rb, line 9
def body
  {
    'InitiatorName': args[:initiator_username],
    'SecurityCredential': credentials,
    'CommandID': args[:command_id],
    'Amount': args[:amount],
    'PartyA': client.shortcode || args[:shortcode],
    'PartyB': args[:phone],
    'Remarks': args[:remarks],
    'QueueTimeOutURL': args[:timeout_url],
    'ResultURL': args[:result_url],
    'Occasion': args[:occasion]
  }
end
call() click to toggle source
# File lib/mpesa/resources/payout.rb, line 5
def call
  Object.new post_request(url: PATH, body: body).body
end
credentials() click to toggle source
# File lib/mpesa/resources/payout.rb, line 24
def credentials
  SecurityCred.new(args[:initiator_password], client.env).password_credential
end