https://github.com/narkoz/azericard
Ruby interface to AzeriCard online payment processing system
https://github.com/narkoz/azericard
azerbaijan azericard payment-processing ruby-gem
Last synced: 2 months ago
JSON representation
Ruby interface to AzeriCard online payment processing system
- Host: GitHub
- URL: https://github.com/narkoz/azericard
- Owner: NARKOZ
- License: bsd-2-clause
- Created: 2013-11-01T13:57:55.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2021-04-08T05:33:23.000Z (about 4 years ago)
- Last Synced: 2024-10-13T18:08:36.793Z (8 months ago)
- Topics: azerbaijan, azericard, payment-processing, ruby-gem
- Language: Ruby
- Homepage: https://narkoz.github.io/azericard
- Size: 28.3 KB
- Stars: 13
- Watchers: 6
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Azericard
Unoffical Ruby interface to AzeriCard online payment processing system.
## Legal
This code is in no way affiliated with, authorised, maintained, sponsored or
endorsed by AzeriCard LLC or any of its affiliates or subsidiaries. This is an
independent and unofficial. Use at your own risk.## Installation
```ruby
gem 'azericard'
# gem 'azericard', github: 'NARKOZ/azericard'
```## Configuration
```ruby
Azericard.configure do |config|
config.endpoint = Settings.azericard.endpoint
config.terminal = Settings.azericard.terminal
config.secret_key = Settings.azericard.secret_keyconfig.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
```ruby
# 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