ibandit 1.14.0 → 1.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/config/locales/da.yml +7 -0
- data/config/locales/de.yml +7 -0
- data/config/locales/en.yml +7 -0
- data/config/locales/es.yml +7 -0
- data/config/locales/fr.yml +7 -0
- data/config/locales/it.yml +9 -1
- data/config/locales/nb.yml +7 -0
- data/config/locales/nl.yml +7 -0
- data/config/locales/pt.yml +7 -0
- data/config/locales/sl.yml +7 -0
- data/config/locales/sv.yml +7 -0
- data/lib/ibandit/constants.rb +4 -0
- data/lib/ibandit/iban.rb +11 -11
- data/lib/ibandit/version.rb +1 -1
- data/lib/ibandit.rb +1 -1
- data/spec/ibandit/iban_spec.rb +375 -2272
- data/spec/spec_helper.rb +6 -44
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 15eee0ef8f82ced114c7aedc52a70c88ab69877928356200917723e0416af1a8
|
4
|
+
data.tar.gz: a1d8b2feda3f775c0c25f481f58194e5e9dab9af2e8d8406007697e96564d178
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a728382a2bb8e522ca8cb547938052f9fdf84dc1d81388e07f6465705c81ea61ad1b0a1cfd84deac1cc5a9f6d873ca98c9f510d1526f07ffff48fa9e746c08fa
|
7
|
+
data.tar.gz: 3a5d6917918b1744b9c4dd86651f6099acea270a4b1029b2f7cbc18b25bdd832271b9780e35c8141bcc8273736859698bb1b0893a3688833d4690e3480486c8e
|
data/CHANGELOG.md
CHANGED
data/config/locales/da.yml
CHANGED
@@ -10,3 +10,10 @@ da:
|
|
10
10
|
invalid_format: "Uventet format for en IBAN fra %{country_code}."
|
11
11
|
is_invalid: "er ugyldig"
|
12
12
|
does_not_support_payments: "understøtter ikke betalinger"
|
13
|
+
has_invalid_format: "ugyldigt format"
|
14
|
+
failed_checksum_test: "bestod ikke kontrolsumtesten"
|
15
|
+
failed_modulus_check: "bestod ikke moduluskontrollen"
|
16
|
+
has_invalid_length: "ugyldig længde"
|
17
|
+
bank_code_does_not_exist: "bankkoden findes ikke"
|
18
|
+
has_invalid_clearing_code_length: "længden på clearingskoden er ugyldig"
|
19
|
+
has_invalid_serial_number: "ugyldigt serienummer"
|
data/config/locales/de.yml
CHANGED
@@ -10,3 +10,10 @@ de:
|
|
10
10
|
invalid_format: "Unerwartetes Format für eine %{country_code}-IBAN."
|
11
11
|
is_invalid: "ist ungültig"
|
12
12
|
does_not_support_payments: "unterstützt keine Zahlungen"
|
13
|
+
has_invalid_format: "Format ist ungültig"
|
14
|
+
failed_checksum_test: "Prüfsummentest nicht bestanden"
|
15
|
+
failed_modulus_check: "Modulprüfung nicht bestanden"
|
16
|
+
has_invalid_length: "Länge ist ungültig"
|
17
|
+
bank_code_does_not_exist: "Bankleitzahl existiert nicht"
|
18
|
+
has_invalid_clearing_code_length: "Länge des Verrechnungscodes ist ungültig"
|
19
|
+
has_invalid_serial_number: "Seriennummer ist ungültig"
|
data/config/locales/en.yml
CHANGED
@@ -10,3 +10,10 @@ en:
|
|
10
10
|
invalid_format: "Unexpected format for a %{country_code} IBAN."
|
11
11
|
is_invalid: "is invalid"
|
12
12
|
does_not_support_payments: "does not support payments"
|
13
|
+
has_invalid_format: "format is invalid"
|
14
|
+
failed_checksum_test: "did not pass checksum test"
|
15
|
+
failed_modulus_check: "did not pass modulus check"
|
16
|
+
has_invalid_length: "length is invalid"
|
17
|
+
bank_code_does_not_exist: "bank code does not exist"
|
18
|
+
has_invalid_clearing_code_length: "clearing code length is invalid"
|
19
|
+
has_invalid_serial_number: "serial number is invalid"
|
data/config/locales/es.yml
CHANGED
@@ -10,3 +10,10 @@ es:
|
|
10
10
|
invalid_format: "Formato inesperado para un IBAN de %{country_code}."
|
11
11
|
is_invalid: "no es válido"
|
12
12
|
does_not_support_payments: "no admite pagos"
|
13
|
+
has_invalid_format: "formato invalido"
|
14
|
+
failed_checksum_test: "fallo en suma de control"
|
15
|
+
failed_modulus_check: "fallo en control de modulo"
|
16
|
+
has_invalid_length: "tamaño invalido"
|
17
|
+
bank_code_does_not_exist: "codigo bancario inexistente"
|
18
|
+
has_invalid_clearing_code_length: "codigo de oficina de oficina de compensación invalido"
|
19
|
+
has_invalid_serial_number: "número de serie invalido"
|
data/config/locales/fr.yml
CHANGED
@@ -10,3 +10,10 @@ fr:
|
|
10
10
|
invalid_format: "Format non attendu pour un IBAN %{country_code}."
|
11
11
|
is_invalid: "n'est pas valide"
|
12
12
|
does_not_support_payments: "ne prend pas en charge les paiements"
|
13
|
+
has_invalid_format: "le format n'est pas valide"
|
14
|
+
failed_checksum_test: "échec du test de la somme de contrôle"
|
15
|
+
failed_modulus_check: "échec du test de module"
|
16
|
+
has_invalid_length: "la longueur n'est pas valide"
|
17
|
+
bank_code_does_not_exist: "le code de la banque n'existe pas"
|
18
|
+
has_invalid_clearing_code_length: "la longueur du clearing code n'est pas valide"
|
19
|
+
has_invalid_serial_number: "le numéro de série n'est pas valide"
|
data/config/locales/it.yml
CHANGED
@@ -9,4 +9,12 @@ it:
|
|
9
9
|
non_alphanumeric_characters: "Caratteri non alfanumerici trovati: %{characters}"
|
10
10
|
invalid_format: "Formato imprevisto per un IBAN %{country_code}."
|
11
11
|
is_invalid: "non è valido"
|
12
|
-
does_not_support_payments: "non supporta i pagamenti"
|
12
|
+
does_not_support_payments: "non supporta i pagamenti"
|
13
|
+
has_invalid_format: "formato non valido"
|
14
|
+
failed_checksum_test: "test del checksum non superato"
|
15
|
+
failed_modulus_check: "test del modulo non superato"
|
16
|
+
has_invalid_length: "lunghezza non valida"
|
17
|
+
bank_code_does_not_exist: "codice banca inesistente"
|
18
|
+
has_invalid_clearing_code_length: "lunghezza clearing code non valida"
|
19
|
+
has_invalid_serial_number: "numero di serie non valido"
|
20
|
+
|
data/config/locales/nb.yml
CHANGED
@@ -10,3 +10,10 @@ nb:
|
|
10
10
|
invalid_format: "Uventet format for IBAN for %{country_code}."
|
11
11
|
is_invalid: "er ikke gyldig"
|
12
12
|
does_not_support_payments: "støtter ikke betalinger"
|
13
|
+
has_invalid_format: "formatet er ugyldig"
|
14
|
+
failed_checksum_test: "besto ikke kontrollsumtesten"
|
15
|
+
failed_modulus_check: "besto ikke tallverdikontrollen"
|
16
|
+
has_invalid_length: "ugyldig lengde"
|
17
|
+
bank_code_does_not_exist: "bankkoden eksisterer ikke"
|
18
|
+
has_invalid_clearing_code_length: "registreringsnummerets lengde er ugyldig"
|
19
|
+
has_invalid_serial_number: "ugyldig serienummer"
|
data/config/locales/nl.yml
CHANGED
@@ -10,3 +10,10 @@ nl:
|
|
10
10
|
invalid_format: "Onverwachte formaat voor een %{country_code} IBAN."
|
11
11
|
is_invalid: "is ongeldig"
|
12
12
|
does_not_support_payments: "ondersteunt geen betalingen"
|
13
|
+
has_invalid_format: "indeling is ongeldig"
|
14
|
+
failed_checksum_test: "checksumtest is mislukt"
|
15
|
+
failed_modulus_check: "moduluscontrole is mislukt"
|
16
|
+
has_invalid_length: "lengte is ongeldig"
|
17
|
+
bank_code_does_not_exist: "bankcode bestaat niet"
|
18
|
+
has_invalid_clearing_code_length: "lengte clearingcode is ongeldig"
|
19
|
+
has_invalid_serial_number: "serienummer is ongeldig"
|
data/config/locales/pt.yml
CHANGED
@@ -10,3 +10,10 @@ pt:
|
|
10
10
|
invalid_format: "Formato inesperado para um IBAN %{country_code}."
|
11
11
|
is_invalid: "é inválido"
|
12
12
|
does_not_support_payments: "não suporta pagamentos"
|
13
|
+
has_invalid_format: "o formato é inválido"
|
14
|
+
failed_checksum_test: "não passou no teste de verificação de soma"
|
15
|
+
failed_modulus_check: "não passou na verificação do módulo"
|
16
|
+
has_invalid_length: "o comprimento é inválido"
|
17
|
+
bank_code_does_not_exist: "o código do banco não existe"
|
18
|
+
has_invalid_clearing_code_length: "o comprimento do código de libertação é inválido"
|
19
|
+
has_invalid_serial_number: "o número de série é inválido"
|
data/config/locales/sl.yml
CHANGED
@@ -10,3 +10,10 @@ sl:
|
|
10
10
|
invalid_format: "Nepričakovana oblika zapisa %{country_code} v IBAN."
|
11
11
|
is_invalid: "ni veljavno"
|
12
12
|
does_not_support_payments: "ne podpira plačil"
|
13
|
+
has_invalid_format: "oblika zapisa ni veljavna"
|
14
|
+
failed_checksum_test: "neuspešen preizkus kontrolne vsote"
|
15
|
+
failed_modulus_check: "neuspešno preverjanje modula"
|
16
|
+
has_invalid_length: "dolžina ni veljavna"
|
17
|
+
bank_code_does_not_exist: "koda banke ne obstaja"
|
18
|
+
has_invalid_clearing_code_length: "dolžina klirinške kode ni veljavna"
|
19
|
+
has_invalid_serial_number: "serijska številka ni veljavna"
|
data/config/locales/sv.yml
CHANGED
@@ -10,3 +10,10 @@ sv:
|
|
10
10
|
invalid_format: "Oväntat format för %{country_code} IBAN."
|
11
11
|
is_invalid: "är ogiltig"
|
12
12
|
does_not_support_payments: "stödjer inte betalningar"
|
13
|
+
has_invalid_format: "ogiltigt format"
|
14
|
+
failed_checksum_test: "felaktig kontrollsumma"
|
15
|
+
failed_modulus_check: "felaktig modulkontroll"
|
16
|
+
has_invalid_length: "ogiltig längd"
|
17
|
+
bank_code_does_not_exist: "bankkoden existerar inte"
|
18
|
+
has_invalid_clearing_code_length: "clearingnumrets längd är ogiltigt"
|
19
|
+
has_invalid_serial_number: "ogiltigt serienummer"
|
data/lib/ibandit/constants.rb
CHANGED
data/lib/ibandit/iban.rb
CHANGED
@@ -247,7 +247,7 @@ module Ibandit
|
|
247
247
|
)
|
248
248
|
true
|
249
249
|
else
|
250
|
-
@errors[:bank_code] = Ibandit.translate(:
|
250
|
+
@errors[:bank_code] = Ibandit.translate(:has_invalid_format)
|
251
251
|
false
|
252
252
|
end
|
253
253
|
end
|
@@ -261,7 +261,7 @@ module Ibandit
|
|
261
261
|
)
|
262
262
|
true
|
263
263
|
else
|
264
|
-
@errors[:branch_code] = Ibandit.translate(:
|
264
|
+
@errors[:branch_code] = Ibandit.translate(:has_invalid_format)
|
265
265
|
false
|
266
266
|
end
|
267
267
|
end
|
@@ -274,7 +274,7 @@ module Ibandit
|
|
274
274
|
)
|
275
275
|
true
|
276
276
|
else
|
277
|
-
@errors[:account_number] = Ibandit.translate(:
|
277
|
+
@errors[:account_number] = Ibandit.translate(:has_invalid_format)
|
278
278
|
false
|
279
279
|
end
|
280
280
|
end
|
@@ -332,7 +332,7 @@ module Ibandit
|
|
332
332
|
def valid_swedish_swift_details?
|
333
333
|
unless Sweden::Validator.bank_code_exists?(swift_bank_code)
|
334
334
|
bank_code_field = bank_code.nil? ? :account_number : :bank_code
|
335
|
-
@errors[bank_code_field] = Ibandit.translate(:
|
335
|
+
@errors[bank_code_field] = Ibandit.translate(:bank_code_does_not_exist)
|
336
336
|
@errors.delete(:bank_code) if bank_code.nil?
|
337
337
|
return false
|
338
338
|
end
|
@@ -344,7 +344,7 @@ module Ibandit
|
|
344
344
|
)
|
345
345
|
|
346
346
|
unless length_valid
|
347
|
-
@errors[:account_number] = Ibandit.translate(:
|
347
|
+
@errors[:account_number] = Ibandit.translate(:has_invalid_length)
|
348
348
|
return false
|
349
349
|
end
|
350
350
|
|
@@ -353,7 +353,7 @@ module Ibandit
|
|
353
353
|
|
354
354
|
def valid_swedish_local_details?
|
355
355
|
unless Sweden::Validator.valid_clearing_code_length?(branch_code)
|
356
|
-
@errors[:branch_code] = Ibandit.translate(:
|
356
|
+
@errors[:branch_code] = Ibandit.translate(:has_invalid_clearing_code_length)
|
357
357
|
return false
|
358
358
|
end
|
359
359
|
|
@@ -363,7 +363,7 @@ module Ibandit
|
|
363
363
|
)
|
364
364
|
|
365
365
|
unless valid_serial_number
|
366
|
-
@errors[:account_number] = Ibandit.translate(:
|
366
|
+
@errors[:account_number] = Ibandit.translate(:has_invalid_serial_number)
|
367
367
|
return false
|
368
368
|
end
|
369
369
|
|
@@ -410,7 +410,7 @@ module Ibandit
|
|
410
410
|
(1 * (code_digits[2] + code_digits[5] + code_digits[8]))
|
411
411
|
) % 10
|
412
412
|
|
413
|
-
@errors[:bank_code] = Ibandit.translate(:
|
413
|
+
@errors[:bank_code] = Ibandit.translate(:failed_checksum_test) unless mod.zero?
|
414
414
|
|
415
415
|
mod.zero?
|
416
416
|
end
|
@@ -518,21 +518,21 @@ module Ibandit
|
|
518
518
|
def valid_modulus_check_bank_code?
|
519
519
|
return true if Ibandit.modulus_checker.valid_bank_code?(self)
|
520
520
|
|
521
|
-
@errors[:bank_code] = Ibandit.translate(:
|
521
|
+
@errors[:bank_code] = Ibandit.translate(:failed_modulus_check)
|
522
522
|
false
|
523
523
|
end
|
524
524
|
|
525
525
|
def valid_modulus_check_branch_code?
|
526
526
|
return true if Ibandit.modulus_checker.valid_branch_code?(self)
|
527
527
|
|
528
|
-
@errors[:branch_code] = Ibandit.translate(:
|
528
|
+
@errors[:branch_code] = Ibandit.translate(:failed_modulus_check)
|
529
529
|
false
|
530
530
|
end
|
531
531
|
|
532
532
|
def valid_modulus_check_account_number?
|
533
533
|
return true if Ibandit.modulus_checker.valid_account_number?(self)
|
534
534
|
|
535
|
-
@errors[:account_number] = Ibandit.translate(:
|
535
|
+
@errors[:account_number] = Ibandit.translate(:failed_modulus_check)
|
536
536
|
false
|
537
537
|
end
|
538
538
|
|
data/lib/ibandit/version.rb
CHANGED