minfraud 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4e3c2e76357a683ceda7350bde7dc4c89cc6055d473b771ee74041d4371f05f7
4
- data.tar.gz: 60aacbf2435a51f65c9d9702e209ddab469d21dd672ba8d5baf34dae807deb2f
3
+ metadata.gz: e2805f5d3d40b2d325926a4a5614b86248bba07f905ffb37ec7dfa9589e97103
4
+ data.tar.gz: 6d70e15b76a295c376232e6bf277e619ed783c23e46460e89e527458813b44ec
5
5
  SHA512:
6
- metadata.gz: ebdccdbdb2d97665faabbf8486cdeb029e1a1d372a09a1ffeff226f5f900d99887e6e370e01515543983c46f86d4083fa347e557d82c5dde265b079e055adddc
7
- data.tar.gz: 61f65f9cc64dd1e0c205c5c2f8df5acfb621dc1ae80b828d5df27e0616964ac0c0a1315b609a4a3228b1f9ecce78dd31411b66513c25eb4311532b3b9f71d775
6
+ metadata.gz: 7a4e77f3d92e6173426e5151b234badc9fbe2503e41178d104eeda51c016835c6459308eaaa810063666030369e89828f1919731add25be6b51e0bf50821704a
7
+ data.tar.gz: a07520d278d5191c2ac5dc9684d9d52ca670a494b088b56b4f8b920a0198ad53469e473d8114e9d33a891e4daa3f5ffa3573cf2190284dfb993b7e57742f9ca3
@@ -7,6 +7,6 @@ jobs:
7
7
  - uses: actions/checkout@v2
8
8
  - uses: ruby/setup-ruby@v1
9
9
  with:
10
- ruby-version: '3.0'
10
+ ruby-version: 3.1
11
11
  - run: bundle install
12
12
  - run: bundle exec rake -t rubocop
@@ -13,6 +13,7 @@ jobs:
13
13
  2.6,
14
14
  2.7,
15
15
  '3.0',
16
+ 3.1,
16
17
  jruby,
17
18
  ]
18
19
  exclude:
data/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # Changelog
2
2
 
3
+ ## v2.1.0 (2022-01-25)
4
+
5
+ * Adds the following new processor to `Minfraud::Components::Payment`:
6
+ * `:windcave`
7
+ * The `last_4_digits` input to `Minfraud::Components::CreditCard` has been
8
+ deprecated in favor of `last_digits` and will be removed in a future
9
+ release. `last_digits`/`last_4_digits` also now supports two digit values
10
+ in addition to the previous four digit values.
11
+ * Eight digit `issuer_id_number` inputs are now supported by
12
+ `Minfraud::Components::CreditCard` in addition to the previously accepted
13
+ six digit `issuer_id_number`. In most cases, you should send the last four
14
+ digits for `last_digits`. If you send an `issuer_id_number` that contains
15
+ an eight digit IIN, and if the credit card brand is not one of the
16
+ following, you should send the last two digits for `last_digits`:
17
+ * `Discover`
18
+ * `JCB`
19
+ * `Mastercard`
20
+ * `UnionPay`
21
+ * `Visa`
22
+
3
23
  ## v2.0.0 (2021-12-06)
4
24
 
5
25
  * Breaking change from 1.x: Removed deprecated methods
@@ -60,7 +80,7 @@
60
80
 
61
81
  ## v1.5.0 (2021-02-02)
62
82
 
63
- * Add the `hash_address` attribute to `Minfraud::Components::Email`. If
83
+ * Adds the `hash_address` attribute to `Minfraud::Components::Email`. If
64
84
  this is `true`, the MD5 hash of the `address` will be sent instead of the
65
85
  plain text `address`. Use this if you prefer to send the hash of the
66
86
  `address` rather than the plain text. Note that this normalizes the
@@ -70,7 +90,7 @@
70
90
  input is set but the `domain` is not.
71
91
  * Adds new payment processors `:apple_pay` and `:aps_payments` to
72
92
  `Minfraud::Components::Payment`.
73
- * Added support for the IP address risk reasons in the minFraud Insights
93
+ * Adds support for the IP address risk reasons in the minFraud Insights
74
94
  and Factors responses. This is available at `.ip_address.risk_reasons`.
75
95
  It is an array of `IPRiskReason` objects.
76
96
 
@@ -84,7 +104,7 @@
84
104
 
85
105
  * IMPORTANT: Ruby 2.0 is no longer supported. If you're using Ruby 2.0,
86
106
  please use version 1.3.0.
87
- * Add handling for the `REQUEST_INVALID` error code.
107
+ * Adds handling for the `REQUEST_INVALID` error code.
88
108
  * The IP address is no longer a required input.
89
109
  * Adds new payment processor `:tsys` to `Minfraud::Components::Payment`.
90
110
 
data/LICENSE.txt CHANGED
@@ -1,7 +1,7 @@
1
1
  The MIT License (MIT)
2
2
 
3
3
  Copyright (c) 2016-2020 kushnir.yb
4
- Copyright (c) 2020-2021 MaxMind, Inc.
4
+ Copyright (c) 2020-2022 MaxMind, Inc.
5
5
 
6
6
  Permission is hereby granted, free of charge, to any person obtaining a copy
7
7
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -123,7 +123,7 @@ assessment = Minfraud::Assessments.new(
123
123
  },
124
124
  credit_card: {
125
125
  issuer_id_number: '411111',
126
- last_4_digits: '7643',
126
+ last_digits: '7643',
127
127
  bank_name: 'Bank of No Hope',
128
128
  bank_phone_country_code: '1',
129
129
  bank_phone_number: '123-456-1234',
@@ -283,7 +283,7 @@ This API uses [Semantic Versioning](https://semver.org/).
283
283
 
284
284
  Copyright (c) 2016-2020 kushnir.yb.
285
285
 
286
- Copyright (c) 2020-2021 MaxMind, Inc.
286
+ Copyright (c) 2020-2022 MaxMind, Inc.
287
287
 
288
288
  The gem is available as open source under the terms of the [MIT
289
289
  License](https://opensource.org/licenses/MIT).
@@ -8,16 +8,18 @@ module Minfraud
8
8
  class CreditCard < Base
9
9
  include Minfraud::Validates
10
10
 
11
- # The issuer ID number for the credit card. This is the first 6 digits of
12
- # the credit card number. It identifies the issuing bank.
11
+ # The issuer ID number for the credit card. This is the first 6 or 8
12
+ # digits of the credit card number. It identifies the issuing bank.
13
13
  #
14
14
  # @return [String, nil]
15
15
  attr_accessor :issuer_id_number
16
16
 
17
- # The last four digits of the credit card number.
17
+ # The last two or four digits of the credit card number.
18
+ #
19
+ # @see https://dev.maxmind.com/minfraud/api-documentation/requests?lang=en#schema--request--credit-card__last_digits
18
20
  #
19
21
  # @return [String, nil]
20
- attr_accessor :last_4_digits
22
+ attr_accessor :last_digits
21
23
 
22
24
  # The name of the issuing bank as provided by the end user.
23
25
  #
@@ -72,12 +74,30 @@ module Minfraud
72
74
  # @return [Boolean, nil]
73
75
  attr_accessor :was_3d_secure_successful
74
76
 
77
+ # Get the last digits of the credit card number.
78
+ #
79
+ # @deprecated Use {::last_digits} instead.
80
+ #
81
+ # @return [String, nil]
82
+ def last_4_digits
83
+ @last_digits
84
+ end
85
+
86
+ # Set the last digits of the credit card number.
87
+ #
88
+ # @deprecated Use {::last_digits} instead.
89
+ #
90
+ # @return [String, nil]
91
+ def last_4_digits=(last4)
92
+ @last_digits = last4
93
+ end
94
+
75
95
  # @param params [Hash] Hash of parameters. Each key/value should
76
96
  # correspond to one of the available attributes.
77
97
  def initialize(params = {})
78
98
  @bank_phone_country_code = params[:bank_phone_country_code]
79
99
  @issuer_id_number = params[:issuer_id_number]
80
- @last_4_digits = params[:last_4_digits]
100
+ @last_digits = params[:last_digits] || params[:last_4_digits]
81
101
  @bank_name = params[:bank_name]
82
102
  @bank_phone_number = params[:bank_phone_number]
83
103
  @avs_result = params[:avs_result]
@@ -94,8 +114,8 @@ module Minfraud
94
114
  return if !Minfraud.enable_validation
95
115
 
96
116
  validate_telephone_country_code('bank_phone_country_code', @bank_phone_country_code)
97
- validate_regex('issuer_id_number', /\A[0-9]{6}\z/, @issuer_id_number)
98
- validate_regex('last_4_digits', /\A[0-9]{4}\z/, @last_4_digits)
117
+ validate_regex('issuer_id_number', /\A(?:[0-9]{6}|[0-9]{8})\z/, @issuer_id_number)
118
+ validate_regex('last_digits', /\A(?:[0-9]{2}|[0-9]{4})\z/, @last_digits)
99
119
  validate_string('bank_name', 255, @bank_name)
100
120
  validate_string('bank_phone_number', 255, @bank_phone_number)
101
121
  validate_string('avs_result', 1, @avs_result)
@@ -164,6 +164,7 @@ module Minfraud
164
164
  virtual_card_services
165
165
  vme
166
166
  vpos
167
+ windcave
167
168
  wirecard
168
169
  worldpay
169
170
  ]
@@ -7,7 +7,7 @@ module Minfraud
7
7
  module Model
8
8
  # Model representing the Factors response.
9
9
  class Factors < Insights
10
- # An object containing subscores for many of the individual components
10
+ # An object containing scores for many of the individual risk factors
11
11
  # that are used to calculate the overall risk score.
12
12
  #
13
13
  # @return [Minfraud::Model::Subscores]
@@ -4,7 +4,7 @@ require 'minfraud/model/abstract'
4
4
 
5
5
  module Minfraud
6
6
  module Model
7
- # Subscores for components that are used in calculating the riskScore.
7
+ # Score for risk factors that are used in calculating the riskScore.
8
8
  class Subscores < Abstract
9
9
  # The risk associated with the AVS result. If present, this is a value in
10
10
  # the range 0.01 to 99.
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Minfraud
4
4
  # The Gem version.
5
- VERSION = '2.0.0'
5
+ VERSION = '2.1.0'
6
6
  end
data/minfraud.gemspec CHANGED
@@ -25,13 +25,13 @@ Gem::Specification.new do |spec|
25
25
  spec.add_runtime_dependency 'connection_pool', '~> 2.2'
26
26
  spec.add_runtime_dependency 'http', '>= 4.3', '< 6.0'
27
27
  spec.add_runtime_dependency 'maxmind-geoip2', '~> 1.1'
28
- spec.add_runtime_dependency 'simpleidn', '>= 0.1.1'
28
+ spec.add_runtime_dependency 'simpleidn', '~> 0.1', '>= 0.1.1'
29
29
 
30
- spec.add_development_dependency 'bundler', '>= 1.16'
31
- spec.add_development_dependency 'rake'
30
+ spec.add_development_dependency 'bundler', '~> 2.2'
31
+ spec.add_development_dependency 'rake', '~> 13.0'
32
32
  spec.add_development_dependency 'rspec', '~> 3.0'
33
- spec.add_development_dependency 'rubocop'
34
- spec.add_development_dependency 'webmock'
33
+ spec.add_development_dependency 'rubocop', '~> 1.23'
34
+ spec.add_development_dependency 'webmock', '~> 3.14'
35
35
  spec.metadata = {
36
36
  'rubygems_mfa_required' => 'true'
37
37
  }
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minfraud
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - kushnir.yb
8
8
  - William Storey
9
- autorequire:
9
+ autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2021-12-06 00:00:00.000000000 Z
12
+ date: 2022-01-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: connection_pool
@@ -63,6 +63,9 @@ dependencies:
63
63
  name: simpleidn
64
64
  requirement: !ruby/object:Gem::Requirement
65
65
  requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0.1'
66
69
  - - ">="
67
70
  - !ruby/object:Gem::Version
68
71
  version: 0.1.1
@@ -70,6 +73,9 @@ dependencies:
70
73
  prerelease: false
71
74
  version_requirements: !ruby/object:Gem::Requirement
72
75
  requirements:
76
+ - - "~>"
77
+ - !ruby/object:Gem::Version
78
+ version: '0.1'
73
79
  - - ">="
74
80
  - !ruby/object:Gem::Version
75
81
  version: 0.1.1
@@ -77,30 +83,30 @@ dependencies:
77
83
  name: bundler
78
84
  requirement: !ruby/object:Gem::Requirement
79
85
  requirements:
80
- - - ">="
86
+ - - "~>"
81
87
  - !ruby/object:Gem::Version
82
- version: '1.16'
88
+ version: '2.2'
83
89
  type: :development
84
90
  prerelease: false
85
91
  version_requirements: !ruby/object:Gem::Requirement
86
92
  requirements:
87
- - - ">="
93
+ - - "~>"
88
94
  - !ruby/object:Gem::Version
89
- version: '1.16'
95
+ version: '2.2'
90
96
  - !ruby/object:Gem::Dependency
91
97
  name: rake
92
98
  requirement: !ruby/object:Gem::Requirement
93
99
  requirements:
94
- - - ">="
100
+ - - "~>"
95
101
  - !ruby/object:Gem::Version
96
- version: '0'
102
+ version: '13.0'
97
103
  type: :development
98
104
  prerelease: false
99
105
  version_requirements: !ruby/object:Gem::Requirement
100
106
  requirements:
101
- - - ">="
107
+ - - "~>"
102
108
  - !ruby/object:Gem::Version
103
- version: '0'
109
+ version: '13.0'
104
110
  - !ruby/object:Gem::Dependency
105
111
  name: rspec
106
112
  requirement: !ruby/object:Gem::Requirement
@@ -119,31 +125,31 @@ dependencies:
119
125
  name: rubocop
120
126
  requirement: !ruby/object:Gem::Requirement
121
127
  requirements:
122
- - - ">="
128
+ - - "~>"
123
129
  - !ruby/object:Gem::Version
124
- version: '0'
130
+ version: '1.23'
125
131
  type: :development
126
132
  prerelease: false
127
133
  version_requirements: !ruby/object:Gem::Requirement
128
134
  requirements:
129
- - - ">="
135
+ - - "~>"
130
136
  - !ruby/object:Gem::Version
131
- version: '0'
137
+ version: '1.23'
132
138
  - !ruby/object:Gem::Dependency
133
139
  name: webmock
134
140
  requirement: !ruby/object:Gem::Requirement
135
141
  requirements:
136
- - - ">="
142
+ - - "~>"
137
143
  - !ruby/object:Gem::Version
138
- version: '0'
144
+ version: '3.14'
139
145
  type: :development
140
146
  prerelease: false
141
147
  version_requirements: !ruby/object:Gem::Requirement
142
148
  requirements:
143
- - - ">="
149
+ - - "~>"
144
150
  - !ruby/object:Gem::Version
145
- version: '0'
146
- description:
151
+ version: '3.14'
152
+ description:
147
153
  email:
148
154
  - support@maxmind.com
149
155
  executables: []
@@ -216,7 +222,7 @@ licenses:
216
222
  - MIT
217
223
  metadata:
218
224
  rubygems_mfa_required: 'true'
219
- post_install_message:
225
+ post_install_message:
220
226
  rdoc_options: []
221
227
  require_paths:
222
228
  - lib
@@ -232,7 +238,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
232
238
  version: '0'
233
239
  requirements: []
234
240
  rubygems_version: 3.2.22
235
- signing_key:
241
+ signing_key:
236
242
  specification_version: 4
237
243
  summary: Ruby API for the minFraud Score, Insights, Factors, and Report Transactions
238
244
  services