0.0
No commit activity in last 3 years
No release in over 3 years
Ruby support for Buckaroo Payment Engine 3.0
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.7
~> 1.0
~> 10.0
~> 3.0

Runtime

 Project Readme

BuckarooClient

Ruby support for Buckaroo Payment Engine 3.0

Installation

Add this line to your application's Gemfile:

gem 'buckaroo_client'

And then execute:

$ bundle

Or install it yourself as:

$ gem install buckaroo_client

Usage

Setup

Set the following ENV vars in your application:

  • BUCKAROO_CLIENT_WEBSITEKEY: website key as generated by Buckaroo
  • BUCKAROO_CLIENT_SECRET: shared secret to digitally sign API requests
  • BUCKAROO_CLIENT_ENVIRONMENT: set this to production to create real transactions. Defaults to test.

Or alternatively, configure using a block (e.g. in a Rails initializer script):

BuckarooClient.configure do |c|
  c.websitekey = 'yourwebsitekey'
  c.secret = 'randomsharedsecretstring'
  c.environment = 'production'
end

Creating a transaction

Start by creating a transaction:

transaction = BuckarooClient.transaction(
  amount: 9.99,
  description: 'Payment',
  # ... more attributes,
  service: BuckarooClient.service(
    :pay_per_email,
    customeremail: 'example@example.com',
    # ... more attributes
  ),
  additional_services: [
    # see `BuckarooClient.service` for available additional services,
    # such as :invoice_specification and :credit_management.
  ]
)

The service and additional_services objects can be quite tricky to configure correctly. See the source code and specs for additional information.

Sending data to Buckaroo Payment Engine

Call the gateway_attributes method on your transaction instance to retrieve request parameters suitable for Buckaroo to process:

request_params = transaction.gateway_attributes

Use BuckarooClient.gateway to set up Buckaroo NVP Gateway transactions. In most cases, you probably only need gateway.transaction_request. Send the request parameters like this:

BuckarooClient.gateway.transaction_request(request_params)

This will send a signed POST request to the Buckaroo gateway.

Known limitations

  • This gem currently only supports PayPerEmail transactions.
  • Batch file creation is experimental and cannot handle invoices with mixed numbers of invoice lines.

Contributing

  1. Fork it ( https://github.com/brightin/buckaroo_client/fork )
  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 a new Pull Request