Dune::Balanced

Build Status Code Climate

What

This is an integration between Balanced and Dune investement, a crowdfunding platform.

How

Include this gem as dependency of your project, adding the following line in your Gemfile.

# Gemfile
gem 'dune-balanced'

And install the migrations:

$ bundle exec rake railties:install:migrations db:migrate

Dune::Balanced is a Rails Engine, integrating with your (dune-investissement) Rails application with very little of effort. To turn the engine on, mount it in an appropriate route:

# config/routes.rb
mount Dune::Balanced::Engine => '/balanced/', as: :dune_balanced

As you might know, Dune has a Configuration class, responsible to... project's configuration. You need to set API key secret and Marketplace ID, and you find yours acessing settings of Balanced Dashboard. Also you need to inform how the debit will appears on the statement.

$ rails runner "Configuration.create!(name: 'balanced_api_key_secret', value: 'YOUR_API_KEY_SECRET_HERE')"
$ rails runner "Configuration.create!(name: 'balanced_marketplace_id', value: 'YOUR_MARKETPLACE_ID_HERE')"
$ rails runner "Configuration.create!(name: 'balanced_appears_on_statement_as', value: 'Neighbor.ly')"

Balanced Webhook

Balanced has a webhook that allow us to receive notifications of events that happen there. We execute a few things when certain events occurs, so you need to add on Balanced Settings the webhook with the following URL:

http://my-dune.com/balanced/notifications

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Running specs

We prize for our test suite and coverage, so it would be great if you could run the specs to ensure that your patch is not breaking the existing codebase.

bundle exec rspec

License

Licensed under the MIT license.