/dotpay

dotpay.pl gem

Primary LanguageRubyMIT LicenseMIT

dotpay.pl gem

<img src=“https://travis-ci.org/friendlyfashion/dotpay.png” />

Description

dotpay.pl gem provides tools for working with dotpay.pl online payments system

How to use

Start by configuring Dotpay:

Dotpay.configure do |config|
  config.account_id           = 1234
  config.pin                  = 'your URLC pin here'
end

Authorizing URLC callback

Sample URLC callback handling action.

def callback
  response = Dotpay::Response.new(params)

  if response.authorized?
    if response.status_done?
      # process your order
    end

    render :text => 'OK', :layout => false
  else
    render :text => 'ERROR', :layout => false
  end
end

Cancelling transaction using cancel API

You can cancel existing transaction:

Dotpay.cancel_transaction(t_id, amount, control)

Also you can do partial refund:

Dotpay.cancel_transaction(t_id, amount, control, type: 2)