Bank of Baku

Ruby interface to Bank of Baku online payment gateway.

Installation

Add this line to your application's Gemfile:

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

And then execute: bundle

Configuration

BankOfBaku.configure do |config|
  config.endpoint = 'https://api.example.com/rest'
  config.username = 'test-user'
  config.password = 'secret'
end

Usage

# Order registration
request_options = {
  orderNumber: rand(1000..2000),
  amount: 5 * 100,
  currency: 944,
  description: 'Lorem ipsum dolor sit amet',
  pageView: %w[DESKTOP MOBILE].sample,
  returnUrl: 'https://merchant.example.net/success',
  failUrl: 'https://merchant.example.net/fail'
}

begin
  BankOfBaku::Request.register request_options
rescue BankOfBaku::Error => e
  e.message
end

# Order status
begin
  BankOfBaku::Request.order_status(orderId: '40f1f684-029f-4d51-910e-cdb8f6453fb1')
rescue BankOfBaku::Error => e
  e.message
end

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake test to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/NARKOZ/bank_of_baku

Copyright (c) 2019 Nihad Abbasov