DIBS payment API wrapper for Ruby. For now it supports only authorize
and
capture
calls.
Add this line to your application's Gemfile:
gem 'dibs'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install dibs
-
Obtain merchant id, key1 and key2 from http://www.dibs.dk/
-
Initialize DIBS class:
@dibs = ::Dibs::Dibs.new(merchant,key1,key2)
-
Construct a hash of required parameters:
parameters = { :amount=>10000, # 100 :currency=>208, # DDK :cardno=>'5019100000000000', :expmon=>'06', :expyear=>'24', :cvc=>'684', :orderId=>"abc_test_#{Time.now.to_s.gsub(/\s/, '_')}", # HAS TO BE UNIQUE :test=>true # DO AS YOU WANT }
-
call
authorize
method and pass in parameters@dibs.authorize(parameters)
-
And you're done :)
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
- Cleanup
- Rest of API methods
- Better error handling?