credit_card_validations 1.3.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
data/README.md
CHANGED
@@ -30,6 +30,7 @@ The following issuing institutes are accepted:
|
|
30
30
|
-----------------------
|
31
31
|
American Express | :amex
|
32
32
|
China UnionPay | :unionpay
|
33
|
+
Dankrot | :dankrot
|
33
34
|
Diners Club | :diners
|
34
35
|
Dinner Club US | :diners_us
|
35
36
|
Discover | :discover
|
@@ -41,6 +42,7 @@ The following issuing institutes are accepted:
|
|
41
42
|
Visa | :visa
|
42
43
|
|
43
44
|
|
45
|
+
|
44
46
|
Examples using string monkey patch
|
45
47
|
|
46
48
|
require 'credit_card_validations/string'
|
@@ -50,7 +50,11 @@ module CreditCardValidations
|
|
50
50
|
]
|
51
51
|
|
52
52
|
UNIONPAY = [
|
53
|
-
{length: [16, 17, 18, 19], prefixes: ['620', '621', '623', '625', '626'], :
|
53
|
+
{length: [16, 17, 18, 19], prefixes: ['620', '621', '623', '625', '626'], skip_validation: true}
|
54
|
+
]
|
55
|
+
|
56
|
+
DANKROT = [
|
57
|
+
{length: [16], prefixes: ['5019']}
|
54
58
|
]
|
55
59
|
|
56
60
|
|
@@ -52,7 +52,7 @@ module CreditCardValidations
|
|
52
52
|
prefixes = Array.wrap(prefixes)
|
53
53
|
length = Array.wrap(length)
|
54
54
|
rules[brand] = [] if rules[brand].blank?
|
55
|
-
rules[brand] << {length: length, regexp: compile_regexp(prefixes), prefixes: prefixes, :
|
55
|
+
rules[brand] << {length: length, regexp: compile_regexp(prefixes), prefixes: prefixes, skip_validation: skip_validation}
|
56
56
|
#create methods like visa? mastercard? etc
|
57
57
|
class_eval <<-BOOLEAN_RULE, __FILE__, __LINE__
|
58
58
|
def #{brand}?
|
@@ -24,7 +24,7 @@ module CreditCardValidations::Mmi
|
|
24
24
|
'4' => 'Banking and financial',
|
25
25
|
'5' => 'Banking and financial',
|
26
26
|
'6' => 'Merchandising and banking/financial',
|
27
|
-
'7' => 'Petroleum and other
|
27
|
+
'7' => 'Petroleum and other industry assignments',
|
28
28
|
'8' => 'Healthcare, telecommunications and other industry assignments',
|
29
29
|
'9' => 'National assignment'
|
30
30
|
|
@@ -33,4 +33,4 @@ module CreditCardValidations::Mmi
|
|
33
33
|
def issuer_category
|
34
34
|
ISSUER_CATEGORIES[@number.to_s[0]]
|
35
35
|
end
|
36
|
-
end
|
36
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: credit_card_validations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-06-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activemodel
|
16
|
-
requirement: &
|
16
|
+
requirement: &70207445779460 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -24,10 +24,10 @@ dependencies:
|
|
24
24
|
version: '4.1'
|
25
25
|
type: :runtime
|
26
26
|
prerelease: false
|
27
|
-
version_requirements: *
|
27
|
+
version_requirements: *70207445779460
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: activesupport
|
30
|
-
requirement: &
|
30
|
+
requirement: &70207445776380 !ruby/object:Gem::Requirement
|
31
31
|
none: false
|
32
32
|
requirements:
|
33
33
|
- - ! '>='
|
@@ -38,10 +38,10 @@ dependencies:
|
|
38
38
|
version: '4.1'
|
39
39
|
type: :runtime
|
40
40
|
prerelease: false
|
41
|
-
version_requirements: *
|
41
|
+
version_requirements: *70207445776380
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: test-unit
|
44
|
-
requirement: &
|
44
|
+
requirement: &70207445774440 !ruby/object:Gem::Requirement
|
45
45
|
none: false
|
46
46
|
requirements:
|
47
47
|
- - ! '>='
|
@@ -49,10 +49,10 @@ dependencies:
|
|
49
49
|
version: '0'
|
50
50
|
type: :development
|
51
51
|
prerelease: false
|
52
|
-
version_requirements: *
|
52
|
+
version_requirements: *70207445774440
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
54
|
name: mocha
|
55
|
-
requirement: &
|
55
|
+
requirement: &70207445787700 !ruby/object:Gem::Requirement
|
56
56
|
none: false
|
57
57
|
requirements:
|
58
58
|
- - ! '>='
|
@@ -60,10 +60,10 @@ dependencies:
|
|
60
60
|
version: '0'
|
61
61
|
type: :development
|
62
62
|
prerelease: false
|
63
|
-
version_requirements: *
|
63
|
+
version_requirements: *70207445787700
|
64
64
|
- !ruby/object:Gem::Dependency
|
65
65
|
name: rake
|
66
|
-
requirement: &
|
66
|
+
requirement: &70207445785800 !ruby/object:Gem::Requirement
|
67
67
|
none: false
|
68
68
|
requirements:
|
69
69
|
- - ! '>='
|
@@ -71,7 +71,7 @@ dependencies:
|
|
71
71
|
version: '0'
|
72
72
|
type: :development
|
73
73
|
prerelease: false
|
74
|
-
version_requirements: *
|
74
|
+
version_requirements: *70207445785800
|
75
75
|
description: A ruby gem for validating credit card numbers (a port of ZF2 Zend\Validator\CreditCard)
|
76
76
|
email:
|
77
77
|
- fedoronchuk@gmail.com
|