Skip to content

creativegs/Banklink-LV

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Swedbank Banklink

Payment system integration for Latvian banks what uses banklink API.

Supported banks

Swedbank (Latvia)
Swedbank (Estonia)

Installation

From Ruby Gems

Not yet in RubyGems

From Git

Insert this into your Gemfile

gem "banklink_lv", :git => 'git://github.com/CreativeMobile/Banklink-LV.git'

Configurations

Insert this in your config file:

SwedbankLv.private_key = File.read("#{Rails.root}/path/to/your_private_key")
SwedbankLv.bank_certificate = File.read("#{Rails.root}/path/to/bank_public_key")
SwedbankLv.production_url = "https://ib.swedbank.lv/banklink"

SwedbankLv.test_private_key = File.read("#{Rails.root}/path/to/your_test_private_key")
SwedbankLv.test_bank_certificate = File.read("#{Rails.root}/path/to/test_bank_public_key")
SwedbankLv.test_url = "https://ib.swedbank.lv/banklink"

Helper for view:

options = {}
options[:amount] = '0.01'
options[:currency] = 'LVL'
options[:return] = 'http://yourapp.com/'
options[:reference] = '454'
options[:message] = 'Testing banklink'
@helper = Banklink::Helper.new(TRANS_ID, YOUR_SENDER_ID, options)

Then create Notification controller for notify. Then you can notify:

notify = Banklink::Notification.new(request.raw_post)
@text
if notify.acknowledge
  if notify.complete?
    @text = "Thanks!"
  elsif notify.failed?
    @text = "You didn't paid!"
  else
    @text = "Wait or other status"
  end
else
  @text = "Stmx went wrong"
end

Thats all!

Testing

You can run the tests from this gem with (inside the banklink_lv directory):

rake

Maintainer

This gem is maintained by Arturs Braucs @ Creative Mobile

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Languages