credit_card_validations 7.1.0 → 8.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2f4c6436dc5dbb57bfc1f1a84f377d1adac3ee41fd243891d60e3138f31d5b0d
4
- data.tar.gz: 30523ff8dab806ea03703f4269c7ed769ef026cb660ad862b3603de9915ffa5b
3
+ metadata.gz: 2ea48b31cccd9e050dd0e59cdd71bb784cf319d355dfa2eb0a185635308b1b81
4
+ data.tar.gz: 3c0358bce72eeb6f265ffb0130dc3a5a843dbf326ef989c118d827c025b8e0c3
5
5
  SHA512:
6
- metadata.gz: 0cd443ca75133dcf28276e4400c908527816aac8bbfaae4313bb2d38209de5664b1323c9c190338d8dea76c614d2df6474a0e3a9586a0186e11fae9b9e035330
7
- data.tar.gz: 3db166c036247ebda14a488e9c12f996041ddd02452a2e06ea7d170d92dc30afab398738a8af4c57e3131403ca8d47a55d4a5a8f3b04ce46461c07748309f5a8
6
+ metadata.gz: 62586d60302f937ec7f47a98440d89767fba557506a5568733e498e2c41d491d5d8f283923590808abc4f1ab3ebe3466dcadb8fbd4a21b721d07337ea4e34133
7
+ data.tar.gz: 366c5f5239778f08035b207b9d1e88e2f3c5f747913b3d86c79b1555fd571a640d16eca7121e78b62fe93f87298a05b9bb9161c7acfe1dcdad2e6a6b100662b2
data/README.md CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  [![Gem Version](http://img.shields.io/gem/v/credit_card_validations.svg)](https://rubygems.org/gems/credit_card_validations)
4
4
  [![License](http://img.shields.io/:license-mit-blue.svg)](http://didww.mit-license.org)
5
+ ![Coverage](https://didww.github.io/credit_card_validations/badge.svg)
5
6
 
6
7
 
7
8
  Gem adds validator to check whether or not a given number actually falls within the ranges of possible numbers prior to performing such verification, and, as such, CreditCardValidations simply verifies that the credit card number provided is well-formed.
@@ -55,11 +56,22 @@ The following issuing institutes are accepted:
55
56
 
56
57
  The following are supported with plugins
57
58
 
58
- | Name | Key |
59
- --------------------- | ------------|
60
- [Diners Club US](http://en.wikipedia.org/wiki/Diners_Club_International#MasterCard_alliance) | :diners_us
59
+ | Name | Key |
60
+ --------------------- | ------------|
61
+ [Cabal](https://en.wikipedia.org/wiki/Cabal_(debit_card)) | :cabal
62
+ [DinaCard](https://en.wikipedia.org/wiki/DinaCard) | :dinacard
63
+ [Diners Club US](http://en.wikipedia.org/wiki/Diners_Club_International#MasterCard_alliance) | :diners_us
61
64
  [EnRoute](https://en.wikipedia.org/wiki/EnRoute_(credit_card)) | :en_route
65
+ [Girocard](https://en.wikipedia.org/wiki/Girocard) | :girocard
66
+ [Hiper](https://en.wikipedia.org/wiki/Itau_Unibanco) | :hiper
67
+ [Humo](https://en.wikipedia.org/wiki/Humo_(payment_system)) | :humocard
62
68
  [Laser](https://en.wikipedia.org/wiki/Laser_%28debit_card%29) | :laser
69
+ [Troy](https://en.wikipedia.org/wiki/Troy_(payment_system)) | :troy
70
+ [UATP](https://en.wikipedia.org/wiki/Universal_Air_Travel_Plan) | :uatp
71
+ [Uzcard](https://en.wikipedia.org/wiki/Uzcard) | :uzcard
72
+ [V Pay](https://en.wikipedia.org/wiki/V_Pay) | :vpay
73
+ [Verve](https://en.wikipedia.org/wiki/Verve_(payment_card)) | :verve
74
+ [Voyager](https://en.wikipedia.org/wiki/Voyager_card) | :voyager
63
75
 
64
76
 
65
77
 
@@ -144,6 +156,18 @@ CreditCardValidations::Factory.random(:maestro)
144
156
  require 'credit_card_validations/plugins/en_route'
145
157
  require 'credit_card_validations/plugins/laser'
146
158
  require 'credit_card_validations/plugins/diners_us'
159
+
160
+ require 'credit_card_validations/plugins/cabal'
161
+ require 'credit_card_validations/plugins/dinacard'
162
+ require 'credit_card_validations/plugins/girocard'
163
+ require 'credit_card_validations/plugins/hiper'
164
+ require 'credit_card_validations/plugins/humocard'
165
+ require 'credit_card_validations/plugins/troy'
166
+ require 'credit_card_validations/plugins/uatp'
167
+ require 'credit_card_validations/plugins/uzcard'
168
+ require 'credit_card_validations/plugins/verve'
169
+ require 'credit_card_validations/plugins/voyager'
170
+ require 'credit_card_validations/plugins/vpay'
147
171
  ```
148
172
 
149
173
 
@@ -0,0 +1,5 @@
1
+ CreditCardValidations.add_brand(
2
+ :cabal,
3
+ { length: 16, prefixes: %w(589657 603522 627170) },
4
+ brand_name: 'Cabal'
5
+ )
@@ -0,0 +1,5 @@
1
+ CreditCardValidations.add_brand(
2
+ :dinacard,
3
+ { length: 16, prefixes: %w(9891) },
4
+ brand_name: 'DinaCard'
5
+ )
@@ -0,0 +1,8 @@
1
+ CreditCardValidations.add_brand(
2
+ :girocard,
3
+ {
4
+ length: 16,
5
+ prefixes: %w(6800 6801 6802 6803 6804 6805 6806 6807 6808 6809)
6
+ },
7
+ brand_name: 'Girocard'
8
+ )
@@ -0,0 +1,8 @@
1
+ CreditCardValidations.add_brand(
2
+ :hiper,
3
+ {
4
+ length: 16,
5
+ prefixes: %w(637095 63737423 63743358 637568 637599 637609 637612)
6
+ },
7
+ brand_name: 'Hiper'
8
+ )
@@ -0,0 +1,5 @@
1
+ CreditCardValidations.add_brand(
2
+ :humocard,
3
+ { length: 16, prefixes: %w(9860) },
4
+ brand_name: 'Humo'
5
+ )
@@ -0,0 +1,5 @@
1
+ CreditCardValidations.add_brand(
2
+ :troy,
3
+ { length: 16, prefixes: %w(9792) },
4
+ brand_name: 'Troy'
5
+ )
@@ -0,0 +1,5 @@
1
+ CreditCardValidations.add_brand(
2
+ :uatp,
3
+ { length: 15, prefixes: %w(1) },
4
+ brand_name: 'UATP'
5
+ )
@@ -0,0 +1,5 @@
1
+ CreditCardValidations.add_brand(
2
+ :uzcard,
3
+ { length: 16, prefixes: %w(8600 5614 277707) },
4
+ brand_name: 'Uzcard'
5
+ )
@@ -0,0 +1,13 @@
1
+ CreditCardValidations.add_brand(
2
+ :verve,
3
+ {
4
+ length: [16, 18, 19],
5
+ prefixes: %w(
6
+ 506099 506100 506101 506102 506103 506104 506105 506106 506107 506108 506109
7
+ 50611 50612 50613 50614 50615 50616 50617 50618
8
+ 506190 506191 506192 506193 506194 506195 506196 506197 506198
9
+ 650002 650003 650004 650005
10
+ )
11
+ },
12
+ brand_name: 'Verve'
13
+ )
@@ -0,0 +1,5 @@
1
+ CreditCardValidations.add_brand(
2
+ :voyager,
3
+ { length: 15, prefixes: %w(7088) },
4
+ brand_name: 'Voyager'
5
+ )
@@ -0,0 +1,8 @@
1
+ CreditCardValidations.add_brand(
2
+ :vpay,
3
+ {
4
+ length: 16,
5
+ prefixes: %w(6310 6382 7389 7582 7628 7748 8820 8987 9451 9820 9887)
6
+ },
7
+ brand_name: 'V Pay'
8
+ )
@@ -1,3 +1,3 @@
1
1
  module CreditCardValidations
2
- VERSION = '7.1.0'
2
+ VERSION = '8.1.0'
3
3
  end
data/lib/data/brands.yaml CHANGED
@@ -34,6 +34,7 @@
34
34
  - '24'
35
35
  - '25'
36
36
  - '26'
37
+ - '270'
37
38
  - '271'
38
39
  - '2720'
39
40
  - '51'
@@ -222,6 +223,8 @@
222
223
  :unionpay:
223
224
  :rules:
224
225
  - :length:
226
+ - 14
227
+ - 15
225
228
  - 16
226
229
  - 17
227
230
  - 18
@@ -304,6 +307,30 @@
304
307
  - '6069'
305
308
  - '607'
306
309
  - '608'
310
+ - '8170'
311
+ - '8171'
312
+ - '8172'
313
+ - '8173'
314
+ - '8174'
315
+ - '8175'
316
+ - '8176'
317
+ - '8177'
318
+ - '8178'
319
+ - '8179'
320
+ - '8180'
321
+ - '8181'
322
+ - '8182'
323
+ - '8192'
324
+ - '8193'
325
+ - '8194'
326
+ - '8195'
327
+ - '8196'
328
+ - '8197'
329
+ - '8198'
330
+ - '8199'
331
+ - '8200'
332
+ - '8201'
333
+ - '8202'
307
334
  :options:
308
335
  :skip_luhn: true
309
336
  :hipercard:
@@ -490,19 +517,7 @@
490
517
  - '36'
491
518
  - '38'
492
519
  - '39'
493
- - '60110'
494
- - '60112'
495
- - '60113'
496
- - '60114'
497
- - '601174'
498
- - '601177'
499
- - '601178'
500
- - '601179'
501
- - '601186'
502
- - '601187'
503
- - '601188'
504
- - '601189'
505
- - '60119'
520
+ - '6011'
506
521
  - '644'
507
522
  - '645'
508
523
  - '646'
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: credit_card_validations
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.1.0
4
+ version: 8.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2026-01-09 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: activemodel
@@ -16,40 +15,28 @@ dependencies:
16
15
  requirements:
17
16
  - - ">="
18
17
  - !ruby/object:Gem::Version
19
- version: '5.2'
20
- - - "<"
21
- - !ruby/object:Gem::Version
22
- version: '8.2'
18
+ version: '7.1'
23
19
  type: :runtime
24
20
  prerelease: false
25
21
  version_requirements: !ruby/object:Gem::Requirement
26
22
  requirements:
27
23
  - - ">="
28
24
  - !ruby/object:Gem::Version
29
- version: '5.2'
30
- - - "<"
31
- - !ruby/object:Gem::Version
32
- version: '8.2'
25
+ version: '7.1'
33
26
  - !ruby/object:Gem::Dependency
34
27
  name: activesupport
35
28
  requirement: !ruby/object:Gem::Requirement
36
29
  requirements:
37
30
  - - ">="
38
31
  - !ruby/object:Gem::Version
39
- version: '5.2'
40
- - - "<"
41
- - !ruby/object:Gem::Version
42
- version: '8.2'
32
+ version: '7.1'
43
33
  type: :runtime
44
34
  prerelease: false
45
35
  version_requirements: !ruby/object:Gem::Requirement
46
36
  requirements:
47
37
  - - ">="
48
38
  - !ruby/object:Gem::Version
49
- version: '5.2'
50
- - - "<"
51
- - !ruby/object:Gem::Version
52
- version: '8.2'
39
+ version: '7.1'
53
40
  - !ruby/object:Gem::Dependency
54
41
  name: minitest
55
42
  requirement: !ruby/object:Gem::Requirement
@@ -114,11 +101,8 @@ extensions: []
114
101
  extra_rdoc_files: []
115
102
  files:
116
103
  - Changelog.md
117
- - Gemfile
118
104
  - LICENSE.txt
119
105
  - README.md
120
- - Rakefile
121
- - credit_card_validations.gemspec
122
106
  - lib/active_model/credit_card_number_validator.rb
123
107
  - lib/credit_card_validations.rb
124
108
  - lib/credit_card_validations/configuration.rb
@@ -127,9 +111,20 @@ files:
127
111
  - lib/credit_card_validations/factory.rb
128
112
  - lib/credit_card_validations/luhn.rb
129
113
  - lib/credit_card_validations/mmi.rb
114
+ - lib/credit_card_validations/plugins/cabal.rb
115
+ - lib/credit_card_validations/plugins/dinacard.rb
130
116
  - lib/credit_card_validations/plugins/diners_us.rb
131
117
  - lib/credit_card_validations/plugins/en_route.rb
118
+ - lib/credit_card_validations/plugins/girocard.rb
119
+ - lib/credit_card_validations/plugins/hiper.rb
120
+ - lib/credit_card_validations/plugins/humocard.rb
132
121
  - lib/credit_card_validations/plugins/laser.rb
122
+ - lib/credit_card_validations/plugins/troy.rb
123
+ - lib/credit_card_validations/plugins/uatp.rb
124
+ - lib/credit_card_validations/plugins/uzcard.rb
125
+ - lib/credit_card_validations/plugins/verve.rb
126
+ - lib/credit_card_validations/plugins/voyager.rb
127
+ - lib/credit_card_validations/plugins/vpay.rb
133
128
  - lib/credit_card_validations/string.rb
134
129
  - lib/credit_card_validations/version.rb
135
130
  - lib/data/brands.yaml
@@ -140,7 +135,6 @@ metadata:
140
135
  bug_tracker_uri: https://github.com/didww/credit_card_validations/issues
141
136
  changelog_uri: https://github.com/didww/credit_card_validations/blob/master/Changelog.md
142
137
  source_code_uri: https://github.com/didww/credit_card_validations
143
- post_install_message:
144
138
  rdoc_options: []
145
139
  require_paths:
146
140
  - lib
@@ -155,8 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
155
149
  - !ruby/object:Gem::Version
156
150
  version: '0'
157
151
  requirements: []
158
- rubygems_version: 3.4.22
159
- signing_key:
152
+ rubygems_version: 3.7.1
160
153
  specification_version: 4
161
154
  summary: gem should be used for credit card numbers validation, card brands detections,
162
155
  luhn checks
data/Gemfile DELETED
@@ -1,7 +0,0 @@
1
- source 'https://rubygems.org'
2
- group :test do
3
- gem 'activemodel', ENV['RAILS_VERSION'], require: false
4
- gem 'activesupport', ENV['RAILS_VERSION'], require: false
5
- end
6
- # Specify your gem's dependencies in credit_card_validations.gemspec
7
- gemspec
data/Rakefile DELETED
@@ -1,13 +0,0 @@
1
- require 'bundler/gem_tasks'
2
-
3
- require 'rake'
4
- require 'rake/testtask'
5
-
6
- task :default => [:specs]
7
-
8
- desc "Run basic specs"
9
- Rake::TestTask.new("specs") { |t|
10
- t.pattern = 'spec/*_spec.rb'
11
- t.verbose = true
12
- t.warning = true
13
- }
@@ -1,43 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'credit_card_validations/version'
5
-
6
- Gem::Specification.new do |gem|
7
- gem.name = 'credit_card_validations'
8
- gem.version = CreditCardValidations::VERSION
9
- gem.authors = ['Igor']
10
- gem.email = ['fedoronchuk@gmail.com']
11
- gem.description = %q{A ruby gem for validating credit card numbers}
12
- gem.summary = 'gem should be used for credit card numbers validation, card brands detections, luhn checks'
13
- gem.homepage = 'http://didww.github.io/credit_card_validations/'
14
- gem.license = 'MIT'
15
-
16
- gem.metadata = {
17
- 'bug_tracker_uri' => 'https://github.com/didww/credit_card_validations/issues',
18
- 'changelog_uri' => 'https://github.com/didww/credit_card_validations/blob/master/Changelog.md',
19
- 'source_code_uri' => 'https://github.com/didww/credit_card_validations'
20
- }
21
-
22
- gem.files = Dir.glob('lib/**/*') + [
23
- 'Changelog.md',
24
- 'Gemfile',
25
- 'LICENSE.txt',
26
- 'Rakefile',
27
- 'README.md',
28
- 'credit_card_validations.gemspec',
29
- ]
30
-
31
- gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
32
- gem.require_paths = ['lib']
33
-
34
-
35
- gem.add_dependency 'activemodel', '>= 5.2', '< 8.2'
36
- gem.add_dependency 'activesupport', '>= 5.2', '< 8.2'
37
-
38
-
39
- gem.add_development_dependency 'minitest'
40
- gem.add_development_dependency 'mocha'
41
- gem.add_development_dependency 'rake'
42
- gem.add_development_dependency 'byebug'
43
- end