Base Commerce SDK
Version: 1.1.3
A gem for interfacing with the Base Commerce API. This gem was developed with their help and serves to provide a Gem wrapper around their own Ruby SDK. Please contact them for more information about the Ruby SDK.
Installation
Add this line to your application's Gemfile:
gem 'basecomm_sdk'
And then execute:
$ bundle
Or install it yourself as:
$ gem install basecomm_sdk
Usage
First, you will need to setup an account with Base Commerce. Use their sandbox for testing, and please read their documentation before you begin.
Read the RSpec examples in the './spec' directory for detailed usage of this gem.
Basics
Include the module.
require 'basecomm_sdk'
Insantiate the Client
# Get your sandbox credentials from Base Commerce
config = {
gateway_username: ENV['BASECOMM_UID'],
gateway_password: ENV['BASECOMM_PWD'],
key: ENV['BASECOMM_KEY'],
sandbox: true # For production set this to false or not at all
}
client = Client.new(config)
Add Bank Account
bank_account = BankAccount.new(...)
returned_bank_account = client.add_bank_account(bank_account)
Add Bank Card
bank_card = BankCard.new(...)
returned_bank_card = client.add_bank_card(bank_card)
Get Bank Account Transaction
bat = client.get_bank_account_transaction(id) # id of the transaction you want
Get Bank Card Transaction
bct = client.get_bank_card_transaction(id)
Process Bank Account Transaction (ACH)
bat = BankAccountTransaction.new(...)
returned_bat = client.process_bank_account_transaction(bat)
Process Bank Card Transaction
bct = BankCardTransaction.new(...)
returned_bct = client.process_bank_card_transaction(bct)
Errata
- We have not used or tested Push Notifications or Settlement Batch APIs.
Updates
We plan to keep this code updated and in sync with any changes in the Base Commerce API. However, for the latest code see the Base Commerce Ruby SDK.
Contributing
- Fork it ( https://github.com/[my-github-username]/basecomm_sdk/fork )
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request