This sample app shows you how to integrate Dwolla tokenization feature with Kill Bill subscriptions APIs.
Ruby 2.1+ or JRuby 1.7.20+ is recommended. If you don’t have a Ruby installation yet, use RVM:
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
\curl -sSL https://get.rvm.io | bash -s stable --ruby
After following the post-installation instructions, you should have access to the ruby and gem executables.
Install the dependencies by running in this folder:
gem install bundler
bundle install
This also assumes:
- A Dwolla Sandbox account is created
- An application is created on the Dwolla account
- Kill Bill is already setup
- The default tenant (bob/lazar) has been created
- The Dwolla plugin is installed and configured
To run the app:
KB_URL='http://<host>:<port>' DWOLLA_CLIENT_ID='<MERCHANT_DWOLLA_CLIENT_ID>' DWOLLA_CLIENT_SECRET='<MERCHANT_DWOLLA_CLIENT_SECRET>' DWOLLA_ACCESS_TOKEN='<MERCHANT_DWOLLA_ACCESS_TOKEN>' ruby app.rb
Then go to http://localhost:4567/ where you should see both Dwolla solutions.
The first option is the White Label solution, that you don't need a Dwolla account and where you are able to select your bank and account by your bank credentials. Steps:
- Press Add Bank by White Label Solution button.
- Select a Bank, follow the steps with any dummy data and complete the checkout process.
The other option is the Dwolla Direct solution, where you are redirect to Dwolla page and you have to login with you Dwolla account. It's also have the option to create a new Dwolla account if you don't have one. Steps:
- Press Sign in by Dwolla Direct Solution link.
- Log in or sign up and complete the checkout process.
This will:
- Get or create a Customer in Dwolla
- Tokenize the bank account in Dwolla
- Create a new Kill Bill account
- Add a default payment method on this account associated with this token
- Create a new subscription for the sports car monthly plan (with a $10 30-days trial)
- Charge the token for $10