minfraud 2.6.0 → 2.7.1

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: 3d7569d3a79d640e8ecd0a2fe83996701e2d378bac780a2e0ee7e40ea0651136
4
- data.tar.gz: 799568df38549e698099950480c8f88e8a395df2214cfd47beb830c9f1c42a85
3
+ metadata.gz: 94219dcd7ef78fdea77b06565b3a73ff8073ea56755f2a9ab25a0d4ba97eb692
4
+ data.tar.gz: a7e3cfa6b732da9f5d23877b4abef0cb7e7641ed30d690af2fc141ee6298cec8
5
5
  SHA512:
6
- metadata.gz: f49ac7777a332043c94e1c73d5cfb34e1caa27477eeebc23ebb31b97929d3012378f40ebd78ca6662982d2ef3fc1f5f6f40862169e381ceb6f710e79c8e5a411
7
- data.tar.gz: 40b65dd1c1eba11d44bb0fc82e0df0e67b943ed43b521198d5c4c4bc81fe2aa79077cc6d4ca86cf873e25f0930e0f7f77b49e4ff68b1b49919cc0d5e92da8b05
6
+ metadata.gz: d79f083900533abbe2fc0d82b5c67d91c8bf81cee4ac95ef37c42c40eb50cf8f1bd1642acc6b80fdc50234f1cded773f47a62548fa0d360bab92c5fcd6b3cbb5
7
+ data.tar.gz: 5d868acf7b455dd212b8481e0c31e1cc9156e5c39a38ddf38d9d230b2344250fbae51551aec91556e532a601f2e51e4424e8c2b02eca024e84b4b23a600f0c2b
data/.rubocop.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  AllCops:
2
- TargetRubyVersion: 2.7
2
+ TargetRubyVersion: '3.0'
3
3
  NewCops: enable
4
4
 
5
5
  # Metrics.
data/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # Changelog
2
2
 
3
+ ## v2.7.1 (2025-02-10)
4
+
5
+ * Re-release due to bug in release workflow.
6
+
7
+ ## v2.7.0 (2025-02-10)
8
+
9
+ * The minFraud Factors subscores have been deprecated. They will be removed
10
+ in March 2025. Please see [our release notes](https://dev.maxmind.com/minfraud/release-notes/2024/#deprecation-of-risk-factor-scoressubscores)
11
+ for more information.
12
+ * Ruby 3.0+ is now required. If you're using Ruby 2.7, please use version
13
+ 2.7.0.beta1 or 2.6.0 of this gem.
14
+ * Added the processor `:epayco` to `Minfraud::Components::Payment`.
15
+
16
+ ## v2.7.0.beta1 (2024-09-06)
17
+
18
+ * Added support for the new risk reasons outputs in minFraud Factors. The risk
19
+ reasons output codes and reasons are currently in beta and are subject to
20
+ change. We recommend that you use these beta outputs with caution and avoid
21
+ relying on them for critical applications.
22
+
3
23
  ## v2.6.0 (2024-07-08)
4
24
 
5
25
  * Updated the validation for the Report Transactions API to make the
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-2024 MaxMind, Inc.
4
+ Copyright (c) 2020-2025 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
@@ -275,7 +275,7 @@ to the client API, please see
275
275
 
276
276
  ## Requirements
277
277
 
278
- This gem works with Ruby 2.7 and above.
278
+ This gem works with Ruby 3.0 and above.
279
279
 
280
280
  ## Contributing
281
281
 
@@ -293,7 +293,7 @@ This API uses [Semantic Versioning](https://semver.org/).
293
293
 
294
294
  Copyright (c) 2016-2020 kushnir.yb.
295
295
 
296
- Copyright (c) 2020-2024 MaxMind, Inc.
296
+ Copyright (c) 2020-2025 MaxMind, Inc.
297
297
 
298
298
  The gem is available as open source under the terms of the [MIT
299
299
  License](https://opensource.org/licenses/MIT).
@@ -68,6 +68,7 @@ module Minfraud
68
68
  elavon
69
69
  emerchantpay
70
70
  epay
71
+ epayco
71
72
  eprocessing_network
72
73
  epx
73
74
  eway
@@ -2,21 +2,39 @@
2
2
 
3
3
  require 'minfraud/model/insights'
4
4
  require 'minfraud/model/subscores'
5
+ require 'minfraud/model/risk_score_reason'
5
6
 
6
7
  module Minfraud
7
8
  module Model
8
9
  # Model representing the Factors response.
9
10
  class Factors < Insights
11
+ # This field contains RiskScoreReason objects that describe risk score reasons
12
+ # for a given transaction that change the risk score significantly.
13
+ # Risk score reasons are usually only returned for medium to high risk transactions.
14
+ # If there were no significant changes to the risk score due to these reasons,
15
+ # then this array will be empty.
16
+ #
17
+ # @return [Array<Minfraud::Model::RiskScoreReason>]
18
+ attr_reader :risk_score_reasons
19
+
10
20
  # An object containing scores for many of the individual risk factors
11
21
  # that are used to calculate the overall risk score.
12
22
  #
13
23
  # @return [Minfraud::Model::Subscores]
24
+ # @deprecated Use {::risk_score_reasons} instead.
14
25
  attr_reader :subscores
15
26
 
16
27
  # @!visibility private
17
28
  def initialize(record, locales)
18
29
  super
19
30
 
31
+ @risk_score_reasons = []
32
+ if record&.key?('risk_score_reasons')
33
+ record['risk_score_reasons'].each do |r|
34
+ @risk_score_reasons << Minfraud::Model::RiskScoreReason.new(r)
35
+ end
36
+ end
37
+
20
38
  @subscores = Minfraud::Model::Subscores.new(get('subscores'))
21
39
  end
22
40
  end
@@ -0,0 +1,90 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'minfraud/model/abstract'
4
+
5
+ module Minfraud
6
+ module Model
7
+ # The risk score reason for the multiplier.
8
+ #
9
+ # This class provides both a machine-readable code and a human-readable
10
+ # explanation of the reason for the risk score, see
11
+ # https://dev.maxmind.com/minfraud/api-documentation/responses/schema--response--risk-score-reason--multiplier-reason.
12
+ # Although more codes may be added in the future, the current codes are:
13
+ #
14
+ # * BROWSER_LANGUAGE - Riskiness of the browser user-agent and
15
+ # language associated with the request.
16
+ # * BUSINESS_ACTIVITY - Riskiness of business activity
17
+ # associated with the request.
18
+ # * COUNTRY - Riskiness of the country associated with the request.
19
+ # * CUSTOMER_ID - Riskiness of a customer's activity.
20
+ # * EMAIL_DOMAIN - Riskiness of email domain.
21
+ # * EMAIL_DOMAIN_NEW - Riskiness of newly-sighted email domain.
22
+ # * EMAIL_ADDRESS_NEW - Riskiness of newly-sighted email address.
23
+ # * EMAIL_LOCAL_PART - Riskiness of the local part of the email address.
24
+ # * EMAIL_VELOCITY - Velocity on email - many requests on same email
25
+ # over short period of time.
26
+ # * ISSUER_ID_NUMBER_COUNTRY_MISMATCH - Riskiness of the country mismatch
27
+ # between IP, billing, shipping and IIN country.
28
+ # * ISSUER_ID_NUMBER_ON_SHOP_ID - Risk of Issuer ID Number for the shop ID.
29
+ # * ISSUER_ID_NUMBER_LAST_DIGITS_ACTIVITY - Riskiness of many recent requests
30
+ # and previous high-risk requests on the IIN and last digits of the credit card.
31
+ # * ISSUER_ID_NUMBER_SHOP_ID_VELOCITY - Risk of recent Issuer ID Number activity
32
+ # for the shop ID.
33
+ # * INTRACOUNTRY_DISTANCE - Risk of distance between IP, billing,
34
+ # and shipping location.
35
+ # * ANONYMOUS_IP - Risk due to IP being an Anonymous IP.
36
+ # * IP_BILLING_POSTAL_VELOCITY - Velocity of distinct billing postal code
37
+ # on IP address.
38
+ # * IP_EMAIL_VELOCITY - Velocity of distinct email address on IP address.
39
+ # * IP_HIGH_RISK_DEVICE - High-risk device sighted on IP address.
40
+ # * IP_ISSUER_ID_NUMBER_VELOCITY - Velocity of distinct IIN on IP address.
41
+ # * IP_ACTIVITY - Riskiness of IP based on minFraud network activity.
42
+ # * LANGUAGE - Riskiness of browser language.
43
+ # * MAX_RECENT_EMAIL - Riskiness of email address
44
+ # based on past minFraud risk scores on email.
45
+ # * MAX_RECENT_PHONE - Riskiness of phone number
46
+ # based on past minFraud risk scores on phone.
47
+ # * MAX_RECENT_SHIP - Riskiness of email address
48
+ # based on past minFraud risk scores on ship address.
49
+ # * MULTIPLE_CUSTOMER_ID_ON_EMAIL - Riskiness of email address
50
+ # having many customer IDs.
51
+ # * ORDER_AMOUNT - Riskiness of the order amount.
52
+ # * ORG_DISTANCE_RISK - Risk of ISP and distance between
53
+ # billing address and IP location.
54
+ # * PHONE - Riskiness of the phone number or related numbers.
55
+ # * CART - Riskiness of shopping cart contents.
56
+ # * TIME_OF_DAY - Risk due to local time of day.
57
+ # * TRANSACTION_REPORT_EMAIL - Risk due to transaction reports
58
+ # on the email address.
59
+ # * TRANSACTION_REPORT_IP - Risk due to transaction reports on the IP address.
60
+ # * TRANSACTION_REPORT_PHONE - Risk due to transaction reports
61
+ # on the phone number.
62
+ # * TRANSACTION_REPORT_SHIP - Risk due to transaction reports
63
+ # on the shipping address.
64
+ # * EMAIL_ACTIVITY - Riskiness of the email address
65
+ # based on minFraud network activity.
66
+ # * PHONE_ACTIVITY - Riskiness of the phone number
67
+ # based on minFraud network activity.
68
+ # * SHIP_ACTIVITY - Riskiness of ship address based on minFraud network activity.
69
+ class Reason < Abstract
70
+ # This value is a machine-readable code identifying the reason.
71
+ #
72
+ # @return [String]
73
+ attr_reader :code
74
+
75
+ # This property provides a human-readable explanation of the reason. The
76
+ # description may change at any time and should not be matched against.
77
+ #
78
+ # @return [String]
79
+ attr_reader :reason
80
+
81
+ # @!visibility private
82
+ def initialize(record)
83
+ super
84
+
85
+ @code = get('code')
86
+ @reason = get('reason')
87
+ end
88
+ end
89
+ end
90
+ end
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'minfraud/model/reason'
4
+
5
+ module Minfraud
6
+ module Model
7
+ # The risk score multiplier and the reasons for that multiplier.
8
+ class RiskScoreReason < Abstract
9
+ # The factor by which the risk score is increased (if the value is greater than 1)
10
+ # or decreased (if the value is less than 1) for given risk reason(s).
11
+ # Multipliers greater than 1.5 and less than 0.66 are considered significant
12
+ # and lead to risk reason(s) being present.
13
+ #
14
+ # @return [Float]
15
+ attr_reader :multiplier
16
+
17
+ # This field contains Risk objects that describe one of the reasons for the multiplier.
18
+ #
19
+ # @return [Array<Minfraud::Model::Risk>]
20
+ attr_reader :reasons
21
+
22
+ # @!visibility private
23
+ def initialize(record)
24
+ super
25
+
26
+ @multiplier = get('multiplier')
27
+
28
+ @reasons = []
29
+ if record&.key?('reasons')
30
+ record['reasons'].each do |r|
31
+ @reasons << Minfraud::Model::Reason.new(r)
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -5,6 +5,8 @@ require 'minfraud/model/abstract'
5
5
  module Minfraud
6
6
  module Model
7
7
  # Score for risk factors that are used in calculating the riskScore.
8
+ #
9
+ # @deprecated Use {RiskScoreReason} instead.
8
10
  class Subscores < Abstract
9
11
  # The risk associated with the AVS result. If present, this is a value in
10
12
  # the range 0.01 to 99.
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Minfraud
4
4
  # The Gem version.
5
- VERSION = '2.6.0'
5
+ VERSION = '2.7.1'
6
6
  end
data/minfraud.gemspec CHANGED
@@ -15,17 +15,17 @@ Gem::Specification.new do |spec|
15
15
  spec.homepage = 'https://github.com/maxmind/minfraud-api-ruby'
16
16
  spec.license = 'MIT'
17
17
 
18
- spec.required_ruby_version = '>= 2.7.0'
18
+ spec.required_ruby_version = '>= 3.0'
19
19
 
20
20
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^.gitignore$|^(?:\.github|dev-bin|spec)/}) }
21
21
  spec.bindir = 'exe'
22
22
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
23
  spec.require_paths = ['lib']
24
24
 
25
- spec.add_runtime_dependency 'connection_pool', '~> 2.2'
26
- spec.add_runtime_dependency 'http', '>= 4.3', '< 6.0'
27
- spec.add_runtime_dependency 'maxmind-geoip2', '~> 1.2'
28
- spec.add_runtime_dependency 'simpleidn', '~> 0.1', '>= 0.1.1'
25
+ spec.add_dependency 'connection_pool', '~> 2.2'
26
+ spec.add_dependency 'http', '>= 4.3', '< 6.0'
27
+ spec.add_dependency 'maxmind-geoip2', '~> 1.2'
28
+ spec.add_dependency 'simpleidn', '~> 0.1', '>= 0.1.1'
29
29
 
30
30
  spec.add_development_dependency 'bundler', '~> 2.2'
31
31
  spec.add_development_dependency 'rake', '~> 13.0'
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minfraud
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 2.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - kushnir.yb
8
8
  - William Storey
9
- autorequire:
10
9
  bindir: exe
11
10
  cert_chain: []
12
- date: 2024-07-08 00:00:00.000000000 Z
11
+ date: 2025-02-10 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: connection_pool
@@ -149,7 +148,6 @@ dependencies:
149
148
  - - "~>"
150
149
  - !ruby/object:Gem::Version
151
150
  version: '3.14'
152
- description:
153
151
  email:
154
152
  - support@maxmind.com
155
153
  executables: []
@@ -204,6 +202,8 @@ files:
204
202
  - lib/minfraud/model/ip_risk_reason.rb
205
203
  - lib/minfraud/model/issuer.rb
206
204
  - lib/minfraud/model/phone.rb
205
+ - lib/minfraud/model/reason.rb
206
+ - lib/minfraud/model/risk_score_reason.rb
207
207
  - lib/minfraud/model/score.rb
208
208
  - lib/minfraud/model/score_ip_address.rb
209
209
  - lib/minfraud/model/shipping_address.rb
@@ -219,7 +219,6 @@ licenses:
219
219
  - MIT
220
220
  metadata:
221
221
  rubygems_mfa_required: 'true'
222
- post_install_message:
223
222
  rdoc_options: []
224
223
  require_paths:
225
224
  - lib
@@ -227,15 +226,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
227
226
  requirements:
228
227
  - - ">="
229
228
  - !ruby/object:Gem::Version
230
- version: 2.7.0
229
+ version: '3.0'
231
230
  required_rubygems_version: !ruby/object:Gem::Requirement
232
231
  requirements:
233
232
  - - ">="
234
233
  - !ruby/object:Gem::Version
235
234
  version: '0'
236
235
  requirements: []
237
- rubygems_version: 3.5.11
238
- signing_key:
236
+ rubygems_version: 3.6.2
239
237
  specification_version: 4
240
238
  summary: Ruby API for the minFraud Score, Insights, Factors, and Report Transactions
241
239
  services