bankscrap-bbva 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bankscrap/bbva/bank.rb +7 -2
- data/lib/bankscrap/bbva/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7375bc2b29f82081f0b061f7813d19a1ead36407
|
4
|
+
data.tar.gz: 60c6fc4d6460586b7294bf8d17e32782a010c0e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d28029fd657bab4a7c0b5353d065b6500ee42580b5cd4625277e2292e01244ce4c9feb35509d1bb9788f6a1f227b4b7528884e6a4d39528195457204182de726
|
7
|
+
data.tar.gz: 06b763f267465d31e60e8bfd641e01428edba1c922676c3757a653c813cb9bb2143dd338b380953da7f66e33f4a1f7c5deb01d0e05b18c2e83fd30cddb11e81e
|
data/lib/bankscrap/bbva/bank.rb
CHANGED
@@ -106,16 +106,21 @@ module Bankscrap
|
|
106
106
|
|
107
107
|
private
|
108
108
|
|
109
|
-
# As far as we know there are
|
109
|
+
# As far as we know there are three types of identifiers BBVA uses
|
110
110
|
# 1) A number of 7 characters that gets passed to the API as it is
|
111
|
-
# 2) A DNI number, this needs to transformed before it
|
111
|
+
# 2) A DNI number, this needs to be transformed before it gets passed to the API
|
112
112
|
# Example: "49021740T" will become "0019-049021740T"
|
113
|
+
# 3) A NIE number, this needs to be transformed before it gets passed to the API
|
114
|
+
# Example: "X1234567T" will become "0019-X1234567T"
|
113
115
|
def format_user(user)
|
114
116
|
user.upcase!
|
115
117
|
|
116
118
|
if user =~ /^[0-9]{8}[A-Z]$/
|
117
119
|
# It's a DNI
|
118
120
|
"0019-0#{user}"
|
121
|
+
elsif user =~ /^[X-Y]([0-9]{6}|[0-9]{7})[A-Z]$/
|
122
|
+
# It's a NIE
|
123
|
+
"0019-#{user}"
|
119
124
|
else
|
120
125
|
user
|
121
126
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bankscrap-bbva
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Javier Cuevas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bankscrap
|