Pin::Ruby
A Ruby library for interacting with v1 of the Pin Payments API.
Installation
Add this line to your application's Gemfile:
gem 'pin-ruby'
And then execute:
$ bundle
Or install it yourself as:
$ gem install pin-ruby
Configuration
Rails application
The Pin library includes a generator to create a config file and initializer for you:
$ rails g pin:install --publishable-key your_key_here --secret-key your_secret_here
The generator adds two files for your rails project:
- config/pin.yml
- config/initializers/pin.rb
Customise the config/pin.yml config file if you wish to use different publishable keys per environment (by default it uses the same token in development, test and production).
The Pin library is configured during rails initialization using the generated files, and no further configuration is necessary before use.
Non-rails application
When using the Pin library in a non-rails application, you must configure it to use your Pin publishable key manually:
Pin.configure do |config|
config.publishable_key = 'YOUR_PUBLISHABLE_KEY'
config.secret_key = 'YOUR_SECRET_KEY'
config.endpoint = 'api.pin.net.au'
end
Usage
TODO: Write usage instructions here
Contributing
- Fork it
- 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 new Pull Request