TransferTo Airtime API
TransferTo helps businesses offer airtime top-ups, goods and services, and mobile money around the world in real time. TransferTo Airtime API enables developers to integrate TransferTo Top-up service into their system.
This gem is a convenience wrapper around the Airtime API. Requirement is that Two Factor Authentication (2FA) is enabled in your TransferTo Shop Security Center section.
Usage
Create a new rails application (the flags used here are just for simplicity):
rails new airtime \
--skip-active-record \
--skip-yarn \
--skip-action-cable \
--skip-sprockets \
--skip-spring \
--skip-coffee \
--skip-javascript \
--skip-turbolinks \
--api
Add this line to your application's Gemfile:
gem 't2_airtime'
And then execute:
$ bundle
Create a .env
file with the required information:
T2_SHOP_USER=
T2_AIRTIME_KEY=
T2_CURRENCY=
Start the server: bundle exec puma -C config/puma.rb
Routes
The following routes are mada available to your application when you mount
the API engine in config/routes.rb
:
mount T2Airtime::Engine => '/airtime'
http://localhost:3000/airtime/transactions
http://localhost:3000/airtime/transactions/<id>
http://localhost:3000/airtime/countries
http://localhost:3000/airtime/<country_id>/operators
http://localhost:3000/airtime/<operator_id>/products
Helpers
Main API helper:
api = T2Airtime::API.api
[TBC]
Development
After checking out the repo, run bin/setup
to install
dependencies. Then, run rake spec
to run the tests. You can
also run bin/console
for an interactive prompt that will allow
you to experiment.
To install this gem onto your local machine, run bundle exec rake
install
. To release a new version, update the version number in
version.rb
, and then run bundle exec rake
release
, which will create a git tag for the version, push git
commits and tags, and push the .gem
file to rubygems.org.
Contributing
Bug reports and pull requests are welcome on GitHub at github.com/[USERNAME]/t2_airtime. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
License
The gem is available as open source under the terms of the MIT License.
Code of Conduct
Everyone interacting in the T2Airtime project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the of conduct[https://github.com/[USERNAME]/t2_airtime/blob/master/CODE_OF_CONDUCT.md].