Project

borika

0.0
No release in over 3 years
Low commit activity in last 3 years
Borika gem for Ruby. Borica Bank 3D Secure Internet Payments in Ruby
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.1
~> 5.0
~> 10.0
 Project Readme

[Unoffical] Borica Ruby Gem for Payments

Visitor Count: Visitor Count

Visit the gem at RubyGems.org

See Borica Bank webpage for Internet 3D Secure Payments

Getting started

Add the following line to your Gemfile:

gem 'borika'

or

gem install borika
require 'borika'

Here is a possible configuration for development config/environments/development.rb:

Borika.configure  do |config|
  config.private_key = File.binread  "testPrivateKey.key"
  config.private_key_password = "Password"
  config.public_key = File.binread "testPublicKey.cer"
  config.borika_terminal_id = "11111111" # Borika KEY 
  config.borika_url = "https://gatet.borica.bg/boreps/"
  config.request_type = "registerTransaction"
end

This parameters are default but you can change it while using on the fly.

Note: You must send the signed CSR file to Borica BANK, otherwise you will get, certificate error.

Example Usage

Let's create a url

order_id = rand(1..200000) # Give your uniq order_id
amaount = rand(100..50000) # Integer with cents
Borika::Request.new(order_id, amount).url

You can also give more parameters, copy the default initializer belowe and modify it.

Borika::Request.new(order_id, amount, order_summary: "Order #{order_id}",
  time: Time.now, language: 'EN', protocol_version: '1.0', currency: 'EUR',
  process_no: 10, request_type: Borika.config.request_type, terminal_id: Borika.config.borika_terminal_id,
  one_time_ticket: nil).url

Lets parse the response comes from callback, in your controller:

Borika::Response.new(params[:eBorica]).hash # returns hash

Testing

Not tested. Works with default parameters. Welcome to pull request.

Contributors

This repository originally inspired from Genadi Samokovarov's Borica Gem

License

GPL Licence. Copyleft. You can copy and modify this software.