# TransferTo Airtime API TransferTo helps businesses offer airtime top-ups, goods and services, and mobile money around the world in real time. This API enables developers to integrate TransferTo Top-up service into their system. If you are building application that leverages international recharge services, then this is the API for you. ## Installation Add this line to your application's Gemfile: ```ruby gem 't2_airtime' ``` And then execute: $ bundle Or install it yourself as: $ gem install t2_airtime ## Usage ### Retrieve your API Token Once you have received your account credentials (login, password) to access the TransferTo web interface, you must log in and retrieve your API token to be used with the TransferTo API. To activate access to your API account, enable Two Factor Authentication (2FA). TSHOP_USER= TSHOP_SECRET= ## Test Execute: $ rspec T2Airtime has a version number has the correct API URL has 7 test numbers responds to ping checks wallet checks number information reserves a transaction id returns a countries list returns a country operators returns an operator products returns error code 0 for PIN based Top-up (successful transaction) returns error code 0 for PIN less Top-up (successful transaction) returns error code 204 (destination number is not a valid prepaid phone number) (FAILED - 1) returns error code 301 (input value out of range or invalid product) (FAILED - 2) returns error code 214 (transaction refused by the operator) (FAILED - 3) returns error code 998 (system not available, please retry later) (FAILED - 4) returns error code 999 (unknown error, please contact support) (FAILED - 5) returns a transaction list Failed examples: rspec ./spec/t2_airtime_spec.rb:99 # T2Airtime returns error code 204 (destination number is not a valid prepaid phone number) rspec ./spec/t2_airtime_spec.rb:108 # T2Airtime returns error code 301 (input value out of range or invalid product) rspec ./spec/t2_airtime_spec.rb:117 # T2Airtime returns error code 214 (transaction refused by the operator) rspec ./spec/t2_airtime_spec.rb:126 # T2Airtime returns error code 998 (system not available, please retry later) rspec ./spec/t2_airtime_spec.rb:135 # T2Airtime returns error code 999 (unknown error, please contact support) ## 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](https://rubygems.org). ## Contributing Bug reports and pull requests are welcome on GitHub at https://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](http://contributor-covenant.org) code of conduct. ## License The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT). ## Code of Conduct Everyone interacting in the T2Airtime project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/t2_airtime/blob/master/CODE_OF_CONDUCT.md).