Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Ruby interface to AzeriCard online payment processing system
branch: master
Failed to load latest commit information.
lib update version
test add missing tests
.gitignore initial commit
Gemfile initial commit
LICENSE.txt update README.md and fix copyright
README.md update README.md and fix copyright
Rakefile add missing tests
azericard.gemspec release 1.0

README.md

Azericard

Responsible for one of the most discussed and popular web projects of 2013, Nihad Abbasov returns to GitHub with a gem that could well follow in its footsteps - Azericard.

Installation

gem 'azericard'
# gem 'azericard', github: 'NARKOZ/azericard'

Configuration

Azericard.configure do |config|
  config.endpoint       = Settings.azericard.endpoint
  config.terminal       = Settings.azericard.terminal
  config.secret_key     = Settings.azericard.secret_key

  config.merchant_name  = Settings.azericard.merchant_name
  config.merchant_email = Settings.azericard.merchant_email
  config.merchant_url   = Settings.azericard.merchant_url
  config.country_code   = Settings.azericard.country_code
  config.gmt_offset     = Settings.azericard.gmt_offset
end

Usage

# Payment authorization
options = {
  amount: @order.amount,
  currency: @order.currency,
  order: @order.number,
  tr_type: 0,
  desc: @order.description,
  backref: azericard_callback_url
}
request_options = Azericard::Request.options_for_request(options)
p_sign = Azericard::Request.generate_mac(request_options.text_to_sign)

# Checkout transaction
options = {
  amount: @order.amount,
  currency: @order.currency,
  order: @order.number,
  tr_type: 21,
  rrn: @order.payment.rrn,
  intref: @order.payment.intref
}
request_options = Azericard::Request.options_for_request(options)

begin
  Azericard::Request.process request_options
rescue Azericard::Error => e
  e.message
end

Copyright

Copyright (c) 2013-2023 Nihad Abbasov

Something went wrong with that request. Please try again.