Stanbic Payment APIs ruby sdk
Install the gem and add to the application's Gemfile by executing:
bundle add stanbic
If bundler is not being used to manage dependencies, install the gem by executing:
gem install stanbic
require "stanbic"
@client = Stanbic::Client.new(api_key: ENV['STANBIC_API_KEY'], api_secret: ENV['STANBIC_API_SECRET'])
Make API calls using the @client object
send_to_stanbic = @client.stanbic_payments(to_account, amount)
to_account
: stanbic recipient account numberREQUIRED
amount
: amount to transactREQUIRED
mobile_transfer = @client.mobile_transfer(sender, receipient, amount, provider)
-
sender
: sender mobile numberREQUIRED
-
receipient
: receipient mobile numberREQUIRED
-
amount
: amount to transactREQUIRED
-
provider
: mobile providerREQUIRED
-
providers :
- MPESA
- T-KASH
- AIRTEL MONEY
mpesa_checkout = @client.mpesa_checkout(mobile_number, amount, bill_account_ref)
mobile_number
: customer being charged mobile numberREQUIRED
amount
: amount being deducted from M-PesaREQUIRED
bill_account_ref
: Stanbic account recieveing the fundsREQUIRED
Note To be implemented
inter_bank_transfer = @client.inter_bank_transfer
to_account
: stanbic recipient account numberREQUIRED
amount
: amount to transactREQUIRED
Bug reports and pull requests are welcome on GitHub at https://github.com/ochiengotieno304/stanbic.
The gem is available as open source under the terms of the MIT License.