banklink_lv 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/Gemfile.lock +92 -0
- data/README +69 -69
- data/README.rdoc +69 -69
- data/Rakefile +3 -38
- data/banklink_lv.gemspec +27 -20
- data/lib/banklink_lv/banklink.rb +134 -134
- data/lib/banklink_lv/base.rb +8 -8
- data/lib/banklink_lv/helper.rb +112 -110
- data/lib/banklink_lv/notification.rb +166 -166
- data/lib/banklink_lv/swedbank.rb +48 -48
- data/lib/banklink_lv/version.rb +2 -2
- data/lib/banklink_lv.rb +5 -9
- data/pkg/banklink_lv-0.0.3.gem +0 -0
- data/test/banklink_common_test.rb +15 -13
- data/test/banklink_helper_test.rb +22 -20
- data/test/banklink_notification_test.rb +42 -40
- data/test/database.yml +2 -2
- data/test/debug.log +6 -6
- data/test/schema.rb +1 -1
- data/test/string_utf8_test.rb +9 -0
- data/test/test_helper.rb +4 -2
- metadata +88 -50
- data/banklink_lv-1.0.1.gem +0 -0
- data/install.rb +0 -1
- data/lib/app/helpers/banklink_helper.rb +0 -26
- data/lib/banklink_lv/core_ext.rb +0 -730
- data/test/banklink_view_helper_test.rb +0 -17
- data/test/core_ext_test.rb +0 -7
- data/uninstall.rb +0 -1
data/Gemfile
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
# Specify your gem's dependencies in banklink_lv.gemspec
|
1
|
+
# Specify your gem's dependencies in banklink_lv.gemspec
|
2
2
|
gemspec
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,92 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
banklink_lv (0.0.3)
|
5
|
+
activesupport
|
6
|
+
rails
|
7
|
+
|
8
|
+
GEM
|
9
|
+
specs:
|
10
|
+
actionmailer (3.2.8)
|
11
|
+
actionpack (= 3.2.8)
|
12
|
+
mail (~> 2.4.4)
|
13
|
+
actionpack (3.2.8)
|
14
|
+
activemodel (= 3.2.8)
|
15
|
+
activesupport (= 3.2.8)
|
16
|
+
builder (~> 3.0.0)
|
17
|
+
erubis (~> 2.7.0)
|
18
|
+
journey (~> 1.0.4)
|
19
|
+
rack (~> 1.4.0)
|
20
|
+
rack-cache (~> 1.2)
|
21
|
+
rack-test (~> 0.6.1)
|
22
|
+
sprockets (~> 2.1.3)
|
23
|
+
activemodel (3.2.8)
|
24
|
+
activesupport (= 3.2.8)
|
25
|
+
builder (~> 3.0.0)
|
26
|
+
activerecord (3.2.8)
|
27
|
+
activemodel (= 3.2.8)
|
28
|
+
activesupport (= 3.2.8)
|
29
|
+
arel (~> 3.0.2)
|
30
|
+
tzinfo (~> 0.3.29)
|
31
|
+
activeresource (3.2.8)
|
32
|
+
activemodel (= 3.2.8)
|
33
|
+
activesupport (= 3.2.8)
|
34
|
+
activesupport (3.2.8)
|
35
|
+
i18n (~> 0.6)
|
36
|
+
multi_json (~> 1.0)
|
37
|
+
arel (3.0.2)
|
38
|
+
builder (3.0.3)
|
39
|
+
erubis (2.7.0)
|
40
|
+
hike (1.2.1)
|
41
|
+
i18n (0.6.1)
|
42
|
+
journey (1.0.4)
|
43
|
+
json (1.7.5)
|
44
|
+
mail (2.4.4)
|
45
|
+
i18n (>= 0.4.0)
|
46
|
+
mime-types (~> 1.16)
|
47
|
+
treetop (~> 1.4.8)
|
48
|
+
mime-types (1.19)
|
49
|
+
multi_json (1.3.6)
|
50
|
+
polyglot (0.3.3)
|
51
|
+
rack (1.4.1)
|
52
|
+
rack-cache (1.2)
|
53
|
+
rack (>= 0.4)
|
54
|
+
rack-ssl (1.3.2)
|
55
|
+
rack
|
56
|
+
rack-test (0.6.1)
|
57
|
+
rack (>= 1.0)
|
58
|
+
rails (3.2.8)
|
59
|
+
actionmailer (= 3.2.8)
|
60
|
+
actionpack (= 3.2.8)
|
61
|
+
activerecord (= 3.2.8)
|
62
|
+
activeresource (= 3.2.8)
|
63
|
+
activesupport (= 3.2.8)
|
64
|
+
bundler (~> 1.0)
|
65
|
+
railties (= 3.2.8)
|
66
|
+
railties (3.2.8)
|
67
|
+
actionpack (= 3.2.8)
|
68
|
+
activesupport (= 3.2.8)
|
69
|
+
rack-ssl (~> 1.3.2)
|
70
|
+
rake (>= 0.8.7)
|
71
|
+
rdoc (~> 3.4)
|
72
|
+
thor (>= 0.14.6, < 2.0)
|
73
|
+
rake (0.9.2.2)
|
74
|
+
rdoc (3.12)
|
75
|
+
json (~> 1.4)
|
76
|
+
sprockets (2.1.3)
|
77
|
+
hike (~> 1.2)
|
78
|
+
rack (~> 1.0)
|
79
|
+
tilt (~> 1.1, != 1.3.0)
|
80
|
+
thor (0.16.0)
|
81
|
+
tilt (1.3.3)
|
82
|
+
treetop (1.4.10)
|
83
|
+
polyglot
|
84
|
+
polyglot (>= 0.3.1)
|
85
|
+
tzinfo (0.3.33)
|
86
|
+
|
87
|
+
PLATFORMS
|
88
|
+
ruby
|
89
|
+
|
90
|
+
DEPENDENCIES
|
91
|
+
banklink_lv!
|
92
|
+
rake
|
data/README
CHANGED
@@ -1,70 +1,70 @@
|
|
1
|
-
= Swedbank Banklink
|
2
|
-
|
3
|
-
Payment system integration for Latvian banks what uses banklink API.
|
4
|
-
|
5
|
-
== Supported banks
|
6
|
-
|
7
|
-
Swedbank (Latvia)
|
8
|
-
|
9
|
-
== Installation
|
10
|
-
|
11
|
-
=== From Ruby Gems
|
12
|
-
|
13
|
-
Not yet in RubyGems
|
14
|
-
|
15
|
-
=== From Git
|
16
|
-
|
17
|
-
Insert this into your Gemfile
|
18
|
-
|
19
|
-
gem "banklink_lv", :git => 'git://github.com/CreativeMobile/Banklink-LV.git'
|
20
|
-
|
21
|
-
=== Configurations
|
22
|
-
|
23
|
-
Insert this in your config file:
|
24
|
-
|
25
|
-
SwedbankLv.private_key = File.read("#{Rails.root}/path/to/your_private_key")
|
26
|
-
SwedbankLv.bank_certificate = File.read("#{Rails.root}/path/to/bank_public_key")
|
27
|
-
SwedbankLv.production_url = "https://ib.swedbank.lv/banklink"
|
28
|
-
|
29
|
-
SwedbankLv.test_private_key = File.read("#{Rails.root}/path/to/your_test_private_key")
|
30
|
-
SwedbankLv.test_bank_certificate = File.read("#{Rails.root}/path/to/test_bank_public_key")
|
31
|
-
SwedbankLv.test_url = "https://ib.swedbank.lv/banklink"
|
32
|
-
|
33
|
-
Helper for view:
|
34
|
-
|
35
|
-
options = {}
|
36
|
-
options[:amount] = '0.01'
|
37
|
-
options[:currency] = 'LVL'
|
38
|
-
options[:return] = 'http://yourapp.com/'
|
39
|
-
options[:reference] = '454'
|
40
|
-
options[:message] = 'Testing banklink'
|
41
|
-
@helper = Banklink::Helper.new(TRANS_ID, YOUR_SENDER_ID, options)
|
42
|
-
|
43
|
-
Then create Notification controller for notify. Then you can notify:
|
44
|
-
|
45
|
-
notify = Banklink::Notification.new(request.raw_post)
|
46
|
-
@text
|
47
|
-
if notify.acknowledge
|
48
|
-
if notify.complete?
|
49
|
-
@text = "Thanks!"
|
50
|
-
elsif notify.failed?
|
51
|
-
@text = "You didn't paid!"
|
52
|
-
else
|
53
|
-
@text = "Wait or other status"
|
54
|
-
end
|
55
|
-
else
|
56
|
-
@text = "Stmx went wrong"
|
57
|
-
end
|
58
|
-
|
59
|
-
Thats all!
|
60
|
-
|
61
|
-
|
62
|
-
== Testing
|
63
|
-
|
64
|
-
You can run the tests from this gem with (inside the banklink_lv directory):
|
65
|
-
|
66
|
-
rake
|
67
|
-
|
68
|
-
== Maintainer
|
69
|
-
|
1
|
+
= Swedbank Banklink
|
2
|
+
|
3
|
+
Payment system integration for Latvian banks what uses banklink API.
|
4
|
+
|
5
|
+
== Supported banks
|
6
|
+
|
7
|
+
Swedbank (Latvia)
|
8
|
+
|
9
|
+
== Installation
|
10
|
+
|
11
|
+
=== From Ruby Gems
|
12
|
+
|
13
|
+
Not yet in RubyGems
|
14
|
+
|
15
|
+
=== From Git
|
16
|
+
|
17
|
+
Insert this into your Gemfile
|
18
|
+
|
19
|
+
gem "banklink_lv", :git => 'git://github.com/CreativeMobile/Banklink-LV.git'
|
20
|
+
|
21
|
+
=== Configurations
|
22
|
+
|
23
|
+
Insert this in your config file:
|
24
|
+
|
25
|
+
SwedbankLv.private_key = File.read("#{Rails.root}/path/to/your_private_key")
|
26
|
+
SwedbankLv.bank_certificate = File.read("#{Rails.root}/path/to/bank_public_key")
|
27
|
+
SwedbankLv.production_url = "https://ib.swedbank.lv/banklink"
|
28
|
+
|
29
|
+
SwedbankLv.test_private_key = File.read("#{Rails.root}/path/to/your_test_private_key")
|
30
|
+
SwedbankLv.test_bank_certificate = File.read("#{Rails.root}/path/to/test_bank_public_key")
|
31
|
+
SwedbankLv.test_url = "https://ib.swedbank.lv/banklink"
|
32
|
+
|
33
|
+
Helper for view:
|
34
|
+
|
35
|
+
options = {}
|
36
|
+
options[:amount] = '0.01'
|
37
|
+
options[:currency] = 'LVL'
|
38
|
+
options[:return] = 'http://yourapp.com/'
|
39
|
+
options[:reference] = '454'
|
40
|
+
options[:message] = 'Testing banklink'
|
41
|
+
@helper = Banklink::Helper.new(TRANS_ID, YOUR_SENDER_ID, options)
|
42
|
+
|
43
|
+
Then create Notification controller for notify. Then you can notify:
|
44
|
+
|
45
|
+
notify = Banklink::Notification.new(request.raw_post)
|
46
|
+
@text
|
47
|
+
if notify.acknowledge
|
48
|
+
if notify.complete?
|
49
|
+
@text = "Thanks!"
|
50
|
+
elsif notify.failed?
|
51
|
+
@text = "You didn't paid!"
|
52
|
+
else
|
53
|
+
@text = "Wait or other status"
|
54
|
+
end
|
55
|
+
else
|
56
|
+
@text = "Stmx went wrong"
|
57
|
+
end
|
58
|
+
|
59
|
+
Thats all!
|
60
|
+
|
61
|
+
|
62
|
+
== Testing
|
63
|
+
|
64
|
+
You can run the tests from this gem with (inside the banklink_lv directory):
|
65
|
+
|
66
|
+
rake
|
67
|
+
|
68
|
+
== Maintainer
|
69
|
+
|
70
70
|
This gem is maintained by {Arturs Braucs @ Creative Mobile}[mailto:arturs@creo.mobi]
|
data/README.rdoc
CHANGED
@@ -1,70 +1,70 @@
|
|
1
|
-
= Swedbank Banklink
|
2
|
-
|
3
|
-
Payment system integration for Latvian banks what uses banklink API.
|
4
|
-
|
5
|
-
== Supported banks
|
6
|
-
|
7
|
-
Swedbank (Latvia)
|
8
|
-
|
9
|
-
== Installation
|
10
|
-
|
11
|
-
=== From Ruby Gems
|
12
|
-
|
13
|
-
Not yet in RubyGems
|
14
|
-
|
15
|
-
=== From Git
|
16
|
-
|
17
|
-
Insert this into your Gemfile
|
18
|
-
|
19
|
-
gem "banklink_lv", :git => 'git://github.com/CreativeMobile/Banklink-LV.git'
|
20
|
-
|
21
|
-
=== Configurations
|
22
|
-
|
23
|
-
Insert this in your config file:
|
24
|
-
|
25
|
-
SwedbankLv.private_key = File.read("#{Rails.root}/path/to/your_private_key")
|
26
|
-
SwedbankLv.bank_certificate = File.read("#{Rails.root}/path/to/bank_public_key")
|
27
|
-
SwedbankLv.production_url = "https://ib.swedbank.lv/banklink"
|
28
|
-
|
29
|
-
SwedbankLv.test_private_key = File.read("#{Rails.root}/path/to/your_test_private_key")
|
30
|
-
SwedbankLv.test_bank_certificate = File.read("#{Rails.root}/path/to/test_bank_public_key")
|
31
|
-
SwedbankLv.test_url = "https://ib.swedbank.lv/banklink"
|
32
|
-
|
33
|
-
Helper for view:
|
34
|
-
|
35
|
-
options = {}
|
36
|
-
options[:amount] = '0.01'
|
37
|
-
options[:currency] = 'LVL'
|
38
|
-
options[:return] = 'http://yourapp.com/'
|
39
|
-
options[:reference] = '454'
|
40
|
-
options[:message] = 'Testing banklink'
|
41
|
-
@helper = Banklink::Helper.new(TRANS_ID, YOUR_SENDER_ID, options)
|
42
|
-
|
43
|
-
Then create Notification controller for notify. Then you can notify:
|
44
|
-
|
45
|
-
notify = Banklink::Notification.new(request.raw_post)
|
46
|
-
@text
|
47
|
-
if notify.acknowledge
|
48
|
-
if notify.complete?
|
49
|
-
@text = "Thanks!"
|
50
|
-
elsif notify.failed?
|
51
|
-
@text = "You didn't paid!"
|
52
|
-
else
|
53
|
-
@text = "Wait or other status"
|
54
|
-
end
|
55
|
-
else
|
56
|
-
@text = "Stmx went wrong"
|
57
|
-
end
|
58
|
-
|
59
|
-
Thats all!
|
60
|
-
|
61
|
-
|
62
|
-
== Testing
|
63
|
-
|
64
|
-
You can run the tests from this gem with (inside the banklink_lv directory):
|
65
|
-
|
66
|
-
rake
|
67
|
-
|
68
|
-
== Maintainer
|
69
|
-
|
1
|
+
= Swedbank Banklink
|
2
|
+
|
3
|
+
Payment system integration for Latvian banks what uses banklink API.
|
4
|
+
|
5
|
+
== Supported banks
|
6
|
+
|
7
|
+
Swedbank (Latvia)
|
8
|
+
|
9
|
+
== Installation
|
10
|
+
|
11
|
+
=== From Ruby Gems
|
12
|
+
|
13
|
+
Not yet in RubyGems
|
14
|
+
|
15
|
+
=== From Git
|
16
|
+
|
17
|
+
Insert this into your Gemfile
|
18
|
+
|
19
|
+
gem "banklink_lv", :git => 'git://github.com/CreativeMobile/Banklink-LV.git'
|
20
|
+
|
21
|
+
=== Configurations
|
22
|
+
|
23
|
+
Insert this in your config file:
|
24
|
+
|
25
|
+
SwedbankLv.private_key = File.read("#{Rails.root}/path/to/your_private_key")
|
26
|
+
SwedbankLv.bank_certificate = File.read("#{Rails.root}/path/to/bank_public_key")
|
27
|
+
SwedbankLv.production_url = "https://ib.swedbank.lv/banklink"
|
28
|
+
|
29
|
+
SwedbankLv.test_private_key = File.read("#{Rails.root}/path/to/your_test_private_key")
|
30
|
+
SwedbankLv.test_bank_certificate = File.read("#{Rails.root}/path/to/test_bank_public_key")
|
31
|
+
SwedbankLv.test_url = "https://ib.swedbank.lv/banklink"
|
32
|
+
|
33
|
+
Helper for view:
|
34
|
+
|
35
|
+
options = {}
|
36
|
+
options[:amount] = '0.01'
|
37
|
+
options[:currency] = 'LVL'
|
38
|
+
options[:return] = 'http://yourapp.com/'
|
39
|
+
options[:reference] = '454'
|
40
|
+
options[:message] = 'Testing banklink'
|
41
|
+
@helper = Banklink::Helper.new(TRANS_ID, YOUR_SENDER_ID, options)
|
42
|
+
|
43
|
+
Then create Notification controller for notify. Then you can notify:
|
44
|
+
|
45
|
+
notify = Banklink::Notification.new(request.raw_post)
|
46
|
+
@text
|
47
|
+
if notify.acknowledge
|
48
|
+
if notify.complete?
|
49
|
+
@text = "Thanks!"
|
50
|
+
elsif notify.failed?
|
51
|
+
@text = "You didn't paid!"
|
52
|
+
else
|
53
|
+
@text = "Wait or other status"
|
54
|
+
end
|
55
|
+
else
|
56
|
+
@text = "Stmx went wrong"
|
57
|
+
end
|
58
|
+
|
59
|
+
Thats all!
|
60
|
+
|
61
|
+
|
62
|
+
== Testing
|
63
|
+
|
64
|
+
You can run the tests from this gem with (inside the banklink_lv directory):
|
65
|
+
|
66
|
+
rake
|
67
|
+
|
68
|
+
== Maintainer
|
69
|
+
|
70
70
|
This gem is maintained by {Arturs Braucs @ Creative Mobile}[mailto:arturs@creo.mobi]
|
data/Rakefile
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
require 'rake'
|
2
2
|
require 'rake/testtask'
|
3
|
-
require '
|
4
|
-
|
3
|
+
require 'rdoc/task'
|
4
|
+
|
5
|
+
require "bundler/gem_tasks"
|
5
6
|
|
6
7
|
desc 'Default: run unit tests.'
|
7
8
|
task :default => :test
|
@@ -12,40 +13,4 @@ Rake::TestTask.new(:test) do |t|
|
|
12
13
|
t.libs << 'test'
|
13
14
|
t.pattern = 'test/**/*_test.rb'
|
14
15
|
t.verbose = true
|
15
|
-
end
|
16
|
-
|
17
|
-
desc 'Generate documentation for the banklink_lv plugin.'
|
18
|
-
Rake::RDocTask.new(:rdoc) do |rdoc|
|
19
|
-
rdoc.rdoc_dir = 'rdoc'
|
20
|
-
rdoc.title = 'BanklinkLv'
|
21
|
-
rdoc.options << '--line-numbers' << '--inline-source'
|
22
|
-
rdoc.rdoc_files.include('README')
|
23
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
24
|
-
end
|
25
|
-
|
26
|
-
PKG_FILES = FileList[
|
27
|
-
'[a-zA-Z]*',
|
28
|
-
'lib/**/*',
|
29
|
-
'rails/**/*',
|
30
|
-
'tasks/**/*',
|
31
|
-
'test/**/*'
|
32
|
-
]
|
33
|
-
|
34
|
-
spec = Gem::Specification.new do |s|
|
35
|
-
s.name = "banklink_lv"
|
36
|
-
s.version = "0.0.1"
|
37
|
-
s.author = "Arturs Braucs"
|
38
|
-
s.email = "arturs.braucs@gmail.com"
|
39
|
-
s.homepage = "http://creo.mobi"
|
40
|
-
s.platform = Gem::Platform::RUBY
|
41
|
-
s.summary = "Banklink integration in your website without active merchant (Latvia)"
|
42
|
-
s.files = PKG_FILES.to_a
|
43
|
-
s.require_path = "lib"
|
44
|
-
s.has_rdoc = false
|
45
|
-
s.extra_rdoc_files = ["README"]
|
46
|
-
end
|
47
|
-
|
48
|
-
desc 'Turn this plugin into a gem.'
|
49
|
-
Rake::GemPackageTask.new(spec) do |pkg|
|
50
|
-
pkg.gem_spec = spec
|
51
16
|
end
|
data/banklink_lv.gemspec
CHANGED
@@ -1,21 +1,28 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
$:.push File.expand_path("../lib", __FILE__)
|
3
|
-
require "banklink_lv/version"
|
4
|
-
|
5
|
-
Gem::Specification.new do |s|
|
6
|
-
s.name = "banklink_lv"
|
7
|
-
s.version = BanklinkLv::VERSION
|
8
|
-
s.author = "Arturs Braucs"
|
9
|
-
s.email = "arturs
|
10
|
-
s.homepage = "https://github.com/CreativeMobile/Banklink-LV"
|
11
|
-
s.platform = Gem::Platform::RUBY
|
12
|
-
s.summary = "Banklink integration in your website without active merchant (Latvia)"
|
13
|
-
s.require_path = "lib"
|
14
|
-
s.has_rdoc = false
|
15
|
-
s.extra_rdoc_files = ["README"]
|
16
|
-
|
17
|
-
s.files = `git ls-files`.split("\n")
|
18
|
-
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
19
|
-
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
20
|
-
s.require_paths = ["lib"]
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "banklink_lv/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "banklink_lv"
|
7
|
+
s.version = BanklinkLv::VERSION
|
8
|
+
s.author = "Arturs Braucs"
|
9
|
+
s.email = ["arturs@creo.mobi"]
|
10
|
+
s.homepage = "https://github.com/CreativeMobile/Banklink-LV"
|
11
|
+
s.platform = Gem::Platform::RUBY
|
12
|
+
s.summary = "Banklink integration in your website without active merchant (Latvia)"
|
13
|
+
s.require_path = "lib"
|
14
|
+
s.has_rdoc = false
|
15
|
+
s.extra_rdoc_files = ["README"]
|
16
|
+
|
17
|
+
s.files = `git ls-files`.split("\n")
|
18
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
19
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
20
|
+
s.require_paths = ["lib"]
|
21
|
+
s.rubyforge_project = "banklink_lv"
|
22
|
+
|
23
|
+
s.add_development_dependency 'rake'
|
24
|
+
|
25
|
+
s.add_dependency "activesupport"
|
26
|
+
s.add_dependency "rails"
|
27
|
+
|
21
28
|
end
|