bankscrap-ing 1.0.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bankscrap-ing.gemspec +1 -1
- data/lib/bankscrap/ing/bank.rb +12 -21
- data/lib/bankscrap/ing/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1007bf78f98d871b9039be4cef30a3d021a0751b
|
4
|
+
data.tar.gz: 840ee1a11e9eab6d9cf45f49c1480e7d8231eda3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2671a8f84e7dba4ebaba40adfc683f716d6db192f81d0d0e1fab86cfcbde281f83ee33a1725529068ae22117295249afc6f5f332588eb6870192caf897301aa
|
7
|
+
data.tar.gz: 0d7e37903319d79a66460a5808d9342587738deaea9654e65891e2be87df6799f8bcfbbb9d3beb5192bfd16a8b6c515fff8af766dcc06d4d7db164cbf3056833
|
data/bankscrap-ing.gemspec
CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
18
|
spec.require_paths = ['lib']
|
19
19
|
|
20
|
-
spec.add_runtime_dependency 'bankscrap', '~>
|
20
|
+
spec.add_runtime_dependency 'bankscrap', '~> 2.0.0'
|
21
21
|
spec.add_runtime_dependency 'rmagick', '~> 2.2', '>= 2.2.2'
|
22
22
|
|
23
23
|
spec.add_development_dependency 'bundler', '~> 1.7'
|
data/lib/bankscrap/ing/bank.rb
CHANGED
@@ -18,19 +18,12 @@ module Bankscrap
|
|
18
18
|
SAMPLE_HEIGHT = 30
|
19
19
|
SAMPLE_ROOT_PATH = '/numbers'.freeze
|
20
20
|
|
21
|
-
|
22
|
-
@dni = user
|
23
|
-
@password = password.to_s
|
24
|
-
@birthday = extra_args.with_indifferent_access['birthday']
|
25
|
-
@log = log
|
26
|
-
@debug = debug
|
21
|
+
REQUIRED_CREDENTIALS = [:dni, :password, :birthday]
|
27
22
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
super
|
23
|
+
def initialize(credentials = {})
|
24
|
+
super do
|
25
|
+
@password = @password.to_s
|
26
|
+
end
|
34
27
|
end
|
35
28
|
|
36
29
|
def balances
|
@@ -97,13 +90,13 @@ module Bankscrap
|
|
97
90
|
|
98
91
|
private
|
99
92
|
|
100
|
-
def
|
101
|
-
selected_positions =
|
93
|
+
def login
|
94
|
+
selected_positions = get_pin_pad_positions
|
102
95
|
ticket = pass_pinpad(selected_positions)
|
103
96
|
post_auth(ticket)
|
104
97
|
end
|
105
98
|
|
106
|
-
def
|
99
|
+
def get_pin_pad_positions
|
107
100
|
add_headers(
|
108
101
|
'Accept' => 'application/json, text/javascript, */*; q=0.01',
|
109
102
|
'Content-Type' => 'application/json; charset=utf-8'
|
@@ -112,7 +105,7 @@ module Bankscrap
|
|
112
105
|
params = {
|
113
106
|
loginDocument: {
|
114
107
|
documentType: 0,
|
115
|
-
document: @dni
|
108
|
+
document: @dni
|
116
109
|
},
|
117
110
|
birthday: @birthday.to_s,
|
118
111
|
companyDocument: nil,
|
@@ -208,9 +201,8 @@ module Bankscrap
|
|
208
201
|
bank: self,
|
209
202
|
id: data['uuid'],
|
210
203
|
name: data['name'],
|
211
|
-
balance: data['balance'],
|
212
|
-
|
213
|
-
available_balance: data['availableBalance'],
|
204
|
+
balance: Money.new(data['balance'] * 100, 'EUR'),
|
205
|
+
available_balance: Money.new(data['availableBalance'] * 100, 'EUR'),
|
214
206
|
description: (data['alias'] || data['name']),
|
215
207
|
iban: data['iban'],
|
216
208
|
bic: data['bic']
|
@@ -235,10 +227,9 @@ module Bankscrap
|
|
235
227
|
account: account,
|
236
228
|
id: data['uuid'],
|
237
229
|
amount: amount,
|
238
|
-
currency: data['EUR'],
|
239
230
|
effective_date: Date.strptime(data['effectiveDate'], '%d/%m/%Y'),
|
240
231
|
description: data['description'],
|
241
|
-
balance: data['balance']
|
232
|
+
balance: Money.new(data['balance'] * 100, 'EUR')
|
242
233
|
)
|
243
234
|
end
|
244
235
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bankscrap-ing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Raúl
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05
|
11
|
+
date: 2016-06-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bankscrap
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 2.0.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 2.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rmagick
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -153,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
153
153
|
version: '0'
|
154
154
|
requirements: []
|
155
155
|
rubyforge_project:
|
156
|
-
rubygems_version: 2.
|
156
|
+
rubygems_version: 2.6.4
|
157
157
|
signing_key:
|
158
158
|
specification_version: 4
|
159
159
|
summary: ING adapter for Bankscrap
|