https://github.com/emilebosch/buckaroo-gem
Buckaroo gem for doing transactions against BPE 3.0, it uses the NVP gateway. It got some slick tests too.
https://github.com/emilebosch/buckaroo-gem
buckaroo buckaroo-gem gateway
Last synced: 2 months ago
JSON representation
Buckaroo gem for doing transactions against BPE 3.0, it uses the NVP gateway. It got some slick tests too.
- Host: GitHub
- URL: https://github.com/emilebosch/buckaroo-gem
- Owner: emilebosch
- Created: 2013-10-28T11:46:36.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2023-01-18T18:24:15.000Z (over 2 years ago)
- Last Synced: 2025-04-11T00:04:39.720Z (2 months ago)
- Topics: buckaroo, buckaroo-gem, gateway
- Language: Ruby
- Homepage:
- Size: 22.5 KB
- Stars: 4
- Watchers: 1
- Forks: 3
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Buckaroo ruby gem
This is a gem to allow buckaroo payments against BPE 3.0. Its right now under development
but will be released in the next couple of days.### How to use
It's easy!
```
gem install buckaroo
```Or add it to your `Gemfile`
#### Setting up your key
First start by setting up your keys:
```
Buckaroo.debug = true
Buckaroo.secret = ENV['BUCK_SECRET']
Buckaroo.key = ENV['BUCK_KEY']
```Use `rbenv-vars` to ease your pain.
#### Creating a payment request
First, let's request a payment, and redirect the user to the payment gatway.
```
reponse = Buckaroo::Charge.create!(
description: 'ten thousand furbies',
amount:1000,
currency:'EUR'
)throw 'Signature invalid' unless response.valid?
if response.require_redirect? redirect_to response.redirect_url
```#### Checking wheter a payment has succeeded after a redirect from Buckaroo
To check the information being send back from the gateway, you can use the `Buckaroo::WebCallback` to process the response.
```
class MyApp < Sinatra::Base
post '/' do
callback = Buckaroo::WebCallback.new(params)
assert callback.valid?
end
end
```### Test
Buckaroo comes with a sweet test suite. It comes with some basic tests, and a full integration test using `phantomjs` against the buckaroo gateway.
Type the following to do the tests (IT WILL DO AN ACTUAL TEST PAYMENT TO BUCKAROO):
```
rake test
```Under the hood it uses, `phantomjs`, `sinatra` and `capybara` to test the functionality end to end.
#### SSH push reverse proxy
It uses a SSH reverse tunnel/proxy that you need to set up to check the webhooks.