credit_card_validations 1.4.2 → 1.4.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NjAyN2VjODkxNmY1OWVhM2M2YjlhYTk0ZTE4ZDQ4Y2NkNjhkZGI0Ng==
4
+ NTBhM2E0ZjA4MzE0ODhlMDBhZjUyMjAzZjg4NDE1YWYxODk3ZmE1MQ==
5
5
  data.tar.gz: !binary |-
6
- NTM3MTY2NzdmYzBiODZiNTk0ODAyMzYxZTEyMDkwM2IwNGI2NTc5NA==
6
+ NWU2OGEzNDg0OGU2M2ZkZmQ2ZTcxYTE1MjA5MzdiMDgwNjI0NTY2Yg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YzY2Y2QwNTA2ZTc2NTFlNmM0NmNhYzBjZTUwNmFkNDU4MTY0YjIzMjBiNmUw
10
- MTA1M2Y5ZGY2OWVjZTQxOTJmNDg1NjAxYTdkYWViODYxNTM2OWIwNjQwMDEz
11
- MTE3MzViOTdjNzQwNmJiYjA4YWRlNmQyMDk3NGFjMDY5NDAxOWQ=
9
+ NTI5MjA5MDIwN2RhYzY4YzBlZDQ2MjlmYzdhZDQ1MjBiYTFmOWY4ZjA3OTli
10
+ NjQ3YjJmZjhiZDUwZDc5MGJhZjkxMDY5YmEwZTkwNDIzMzM3ZDU3OGEzMTkw
11
+ ZGQxODU5NWFiMmY4Zjg5NzUzYzc3MzllZGY4MmZkMmUzNDAyYWI=
12
12
  data.tar.gz: !binary |-
13
- YWQ0OGIyODBhMmU0ZmM1ZGVkYzBjODA0Y2U1MTA4NzBiMmY0YzFmOWZiMTU2
14
- ZmMxZTM2YWE5OTk0M2I3Mzg1NTA0MjIzYjc2NTQ0N2E5NGNhZTRjYjY4N2Fj
15
- MjcyNDhmNjhhNmQ1Yzg2ZWFmM2JjODhlOWRlYzQ1MzYzY2JjNjU=
13
+ ZDFlNzc4MTBmZGU3YWJjYWI4ZTJjMTczYTRkYzNhMmQ2NzA0NTgzZDZjODNh
14
+ NjYwYmM0NDVjNmQ4ZjNmOTI1NzY4MGIxYTY5MjEzMzBhNTQ0MzY5MTljN2Fh
15
+ ZGZjZmU2N2FlMzliMTk2ODRmYjJjM2FhNWQ5ZmNhZDQ4ZmZjYzk=
data/README.md CHANGED
@@ -72,6 +72,11 @@ Example
72
72
 
73
73
 
74
74
 
75
+ Check luhn
76
+
77
+ CreditCardValidations::Detector.new(@credit_card_number).valid_luhn?
78
+
79
+
75
80
  ActiveModel support
76
81
 
77
82
  only for certain brads
@@ -19,11 +19,11 @@ Gem::Specification.new do |gem|
19
19
  gem.require_paths = ["lib"]
20
20
 
21
21
 
22
- gem.add_dependency "activemodel", ">= 3.0", "<= 4.2"
23
- gem.add_dependency "activesupport", ">= 3.0", "<= 4.2"
22
+ gem.add_dependency "activemodel", ">= 3", "< 5"
23
+ gem.add_dependency "activesupport", ">= 3", "< 5"
24
24
 
25
- gem.add_development_dependency "test-unit",'~> 2.5'
26
- gem.add_development_dependency "mocha", '~> 0.12'
25
+ gem.add_development_dependency "test-unit",'2.5.0'
26
+ gem.add_development_dependency "mocha", '0.12'
27
27
  gem.add_development_dependency 'rake', '~> 10'
28
28
 
29
29
  end
@@ -37,16 +37,24 @@ module CreditCardValidations
37
37
 
38
38
 
39
39
  laser: [
40
- {length: [16, 17, 18, 19], prefixes: ['6304', '6706', '6771', '6709']}
41
- ],
42
-
43
- maestro: [
44
- {length: [12, 13, 14, 15, 16, 17, 18, 19], prefixes: ['5018', '5020', '5038', '6304', '6759', '6761', '6762', '6763', '6764', '6765', '6766']}
40
+ {length: [16, 17, 18, 19], prefixes: ['6304', '6706', '6771']}
45
41
  ],
46
42
 
47
43
  solo: [
48
44
  {length: [16, 18, 19], prefixes: ['6334', '6767']}
49
45
  ],
46
+
47
+ maestro: [
48
+ {length: [12, 13, 14, 15, 16, 17, 18, 19], prefixes: ['5010', '5011', '5012', '5013', '5014', '5015', '5016', '5017', '5018',
49
+ '502', '503', '504', '505', '506', '507', '508',
50
+ '6012', '6013', '6014', '6015', '6016', '6017', '6018', '6019',
51
+ '602', '603', '604', '605', '606',
52
+ '677', '675', '674', '673', '672', '671', '670',
53
+ '6760', '6761', '6762', '6763', '6764', '6765', '6766', '6768', '6769'
54
+ ]
55
+ }
56
+ ],
57
+
50
58
  # Luhn validation are skipped for union pay cards because they have unknown generation algoritm
51
59
  unionpay: [
52
60
  {length: [16, 17, 18, 19], prefixes: ['622', '624', '625', '626', '628'], skip_validation: true}
@@ -54,7 +62,7 @@ module CreditCardValidations
54
62
 
55
63
  dankrot: [
56
64
  {length: [16], prefixes: ['5019']}
57
- ],
65
+ ]
58
66
  }
59
67
  end
60
68
  end
@@ -1,3 +1,3 @@
1
1
  module CreditCardValidations
2
- VERSION = "1.4.2"
2
+ VERSION = "1.4.3"
3
3
  end
@@ -1,5 +1,5 @@
1
1
  require 'test/unit'
2
- require 'mocha/setup'
2
+ require 'mocha'
3
3
  lib = File.expand_path("#{File.dirname(__FILE__)}/../lib")
4
4
  unit_tests = File.expand_path("#{File.dirname(__FILE__)}/../test")
5
5
  $:.unshift(lib)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: credit_card_validations
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.2
4
+ version: 1.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-03 00:00:00.000000000 Z
11
+ date: 2014-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -16,66 +16,66 @@ dependencies:
16
16
  requirements:
17
17
  - - ! '>='
18
18
  - !ruby/object:Gem::Version
19
- version: '3.0'
20
- - - <=
19
+ version: '3'
20
+ - - <
21
21
  - !ruby/object:Gem::Version
22
- version: '4.2'
22
+ version: '5'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
- version: '3.0'
30
- - - <=
29
+ version: '3'
30
+ - - <
31
31
  - !ruby/object:Gem::Version
32
- version: '4.2'
32
+ version: '5'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: activesupport
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - ! '>='
38
38
  - !ruby/object:Gem::Version
39
- version: '3.0'
40
- - - <=
39
+ version: '3'
40
+ - - <
41
41
  - !ruby/object:Gem::Version
42
- version: '4.2'
42
+ version: '5'
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - ! '>='
48
48
  - !ruby/object:Gem::Version
49
- version: '3.0'
50
- - - <=
49
+ version: '3'
50
+ - - <
51
51
  - !ruby/object:Gem::Version
52
- version: '4.2'
52
+ version: '5'
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: test-unit
55
55
  requirement: !ruby/object:Gem::Requirement
56
56
  requirements:
57
- - - ~>
57
+ - - '='
58
58
  - !ruby/object:Gem::Version
59
- version: '2.5'
59
+ version: 2.5.0
60
60
  type: :development
61
61
  prerelease: false
62
62
  version_requirements: !ruby/object:Gem::Requirement
63
63
  requirements:
64
- - - ~>
64
+ - - '='
65
65
  - !ruby/object:Gem::Version
66
- version: '2.5'
66
+ version: 2.5.0
67
67
  - !ruby/object:Gem::Dependency
68
68
  name: mocha
69
69
  requirement: !ruby/object:Gem::Requirement
70
70
  requirements:
71
- - - ~>
71
+ - - '='
72
72
  - !ruby/object:Gem::Version
73
73
  version: '0.12'
74
74
  type: :development
75
75
  prerelease: false
76
76
  version_requirements: !ruby/object:Gem::Requirement
77
77
  requirements:
78
- - - ~>
78
+ - - '='
79
79
  - !ruby/object:Gem::Version
80
80
  version: '0.12'
81
81
  - !ruby/object:Gem::Dependency
@@ -134,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
134
  version: '0'
135
135
  requirements: []
136
136
  rubyforge_project:
137
- rubygems_version: 2.2.0
137
+ rubygems_version: 2.2.2
138
138
  signing_key:
139
139
  specification_version: 4
140
140
  summary: gem for credit card numbers validation, card brands detections