Getting Connected with BancBox APIs using Ruby
BancBox is a complete payments services platform that lets you collect money in a variety of ways.
This sample web application shows you how to connect BancBox APIs via Ruby and Sinatra.
Make sure you have Ruby installed in your system. (This app is tested with ruby 1.9.3 but it should be ok on other versions as well).
Sign up for BancBox to get your developer credentials.
$ gem install bunder
Install required gems.
$ bundle install
Copy .env.sample file and edit it to match your credentials received from Bancbox.
$ mv .env.sample .env
Run the application
$ foreman run shotgun -s thin
Visit http://localhost:9393/ on your browser to make sure it is running.
BancBox currently is using SOAP for its API. Thanks to Savon, an awesome Ruby SOAP library, it is not hard to connect to these services. Check client.rb for a starting point on how to setup properly to access BancBox APIs and how to create an API client.
The web app, which is a single file (app.rb), uses this client to access 3 services on BancBox: CreateClient, SearchClients and GetClient. Savon automatically handles naming to match Ruby naming conventions. Check Savon's documentation for more info on this.
You can find more info at BancBox site for full documentation of available services.