minfraud 2.9.0 → 2.10.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.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +18 -0
  3. data/LICENSE.txt +1 -1
  4. data/README.md +12 -9
  5. data/lib/minfraud/assessments.rb +1 -1
  6. data/lib/minfraud/components/account.rb +1 -1
  7. data/lib/minfraud/components/base.rb +3 -0
  8. data/lib/minfraud/components/billing.rb +1 -1
  9. data/lib/minfraud/components/credit_card.rb +8 -7
  10. data/lib/minfraud/components/custom_inputs.rb +1 -1
  11. data/lib/minfraud/components/device.rb +8 -1
  12. data/lib/minfraud/components/email.rb +1 -1
  13. data/lib/minfraud/components/event.rb +3 -3
  14. data/lib/minfraud/components/order.rb +2 -2
  15. data/lib/minfraud/components/payment.rb +5 -1
  16. data/lib/minfraud/components/report/transaction.rb +5 -4
  17. data/lib/minfraud/components/shipping.rb +1 -1
  18. data/lib/minfraud/components/shopping_cart.rb +1 -1
  19. data/lib/minfraud/components/shopping_cart_item.rb +4 -4
  20. data/lib/minfraud/enum.rb +6 -0
  21. data/lib/minfraud/http_service/response.rb +4 -2
  22. data/lib/minfraud/model/abstract.rb +3 -0
  23. data/lib/minfraud/model/device.rb +1 -1
  24. data/lib/minfraud/model/email.rb +2 -1
  25. data/lib/minfraud/model/email_domain.rb +3 -2
  26. data/lib/minfraud/model/email_domain_visit.rb +10 -7
  27. data/lib/minfraud/model/factors.rb +1 -1
  28. data/lib/minfraud/model/geoip2_location.rb +1 -1
  29. data/lib/minfraud/model/insights.rb +1 -1
  30. data/lib/minfraud/model/ip_address.rb +1 -1
  31. data/lib/minfraud/model/reason.rb +1 -1
  32. data/lib/minfraud/model/shipping_address.rb +3 -1
  33. data/lib/minfraud/model/warning.rb +13 -2
  34. data/lib/minfraud/report.rb +1 -1
  35. data/lib/minfraud/validates.rb +139 -2
  36. data/lib/minfraud/version.rb +1 -1
  37. metadata +20 -19
  38. data/.rspec +0 -2
  39. data/.rubocop.yml +0 -113
  40. data/CLAUDE.md +0 -443
  41. data/CODE_OF_CONDUCT.md +0 -49
  42. data/Gemfile +0 -5
  43. data/README.dev.md +0 -28
  44. data/Rakefile +0 -12
  45. data/bin/console +0 -15
  46. data/bin/setup +0 -8
  47. data/minfraud.gemspec +0 -42
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7182466f12206a3a2d7639cabb6d7937e10d91dc7bac4684482b38b27dc1237e
4
- data.tar.gz: 2a304dbe22670677bd3aaa7fbdba6b738ea460652893c351bf686861e63dd56d
3
+ metadata.gz: 2e9a3d34fdcba8b336c22ccfb3088f42cf08e9debccc2a9f97e80cefe5f2c79d
4
+ data.tar.gz: 851ce59eec3a798f76821ddcd06e73840d5911735aa0f8be802c95caa340005f
5
5
  SHA512:
6
- metadata.gz: 347bc9a5c45f747e1bca1608b6d4c0623d11627cdbca48657b45fd3bf7f04b21d4aae579fe81333935477a6dcd5d6e59a95a0ba5df18560a7969385661aab0ac
7
- data.tar.gz: 90eeb55ddfc1f93fcf3eb981ed34a79402910e6ca097b7e4cb7098c847e414c01c628dc1f5a3d113d299621596172e2a5adef1affd88c6103e0e8217b37206e2
6
+ metadata.gz: 4d5832ed02bbfe75d68e1232629815a1fe18be611f62d01b04c361d99efdc6125970abde150bd8ff52be2725c177bd72ac4600fee9030cabb53913eb552c7131
7
+ data.tar.gz: 9a8e36fb6925f617296fc4d5c472f3fed5d73a95715aaf3f5c098987ffb74e6218e7509a24fb0b38c73458e149969fdbcf05052a8b9b86ef9d631d921b13b211
data/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## v2.10.0 (2026-07-21)
4
+
5
+ * Added the `residential` attribute to the `anonymizer` object on
6
+ `Minfraud::Model::IPAddress`. This object contains residential proxy
7
+ data for the network, including a confidence score, the network last
8
+ seen date, and the provider name. It may be populated even when no
9
+ other anonymizer attributes are set. This is only available from the
10
+ minFraud Insights and Factors web services.
11
+ * Added the `tracking_token` attribute to `Minfraud::Components::Device`.
12
+ This is the token generated by the
13
+ [Device Tracking Add-on](https://dev.maxmind.com/minfraud/track-devices)
14
+ for explicit device linking.
15
+ * Added the processors `:banquest`, `:fat_zebra`, `:summit_payments`, and
16
+ `:yaadpay` to `Minfraud::Components::Payment`.
17
+ * Added `:clear` to the valid values for the `tag` attribute on
18
+ `Minfraud::Components::Report::Transaction`.
19
+ * Unnecessary files were removed from the published .gem.
20
+
3
21
  ## v2.9.0 (2025-11-20)
4
22
 
5
23
  * Added the processor `:securepay` to `Minfraud::Components::Payment`.
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-2025 MaxMind, Inc.
4
+ Copyright (c) 2020-2026 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
@@ -3,9 +3,9 @@
3
3
  ## Description
4
4
 
5
5
  This package provides an API for the [MaxMind minFraud web
6
- services](https://dev.maxmind.com/minfraud?lang=en). This includes minFraud Score,
6
+ services](https://dev.maxmind.com/minfraud/?lang=en). This includes minFraud Score,
7
7
  Insights, and Factors. It also includes our [minFraud Report Transaction
8
- API](https://dev.maxmind.com/minfraud/report-a-transaction?lang=en).
8
+ API](https://dev.maxmind.com/minfraud/report-a-transaction/?lang=en).
9
9
 
10
10
  The legacy minFraud Standard and Premium services are not supported by this
11
11
  API.
@@ -48,7 +48,7 @@ Minfraud.configure do |c|
48
48
  c.license_key = 'your_license_key'
49
49
  c.enable_validation = true
50
50
  end
51
- ````
51
+ ```
52
52
 
53
53
  To use the Sandbox web service instead of the production web service, you can provide the host:
54
54
 
@@ -69,8 +69,8 @@ creating the object.
69
69
 
70
70
  After populating the object, call the method for the minFraud endpoint you
71
71
  want to use: `#score`, `#insights`, or `#factors`. The returned value is a
72
- `MinFraud::Response` object. You can access the response model through its
73
- `#body` attribute.
72
+ `Minfraud::HTTPService::Response` object. You can access the response model
73
+ through its `#body` attribute.
74
74
 
75
75
  An exception will be thrown for critical errors. You should check for
76
76
  `warnings` related to your inputs after a request.
@@ -83,6 +83,7 @@ assessment = Minfraud::Assessments.new(
83
83
  accept_language: 'en-US,en;q=0.8',
84
84
  session_age: 3600.5,
85
85
  session_id: 'foo',
86
+ tracking_token: 'abc123',
86
87
  user_agent: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.89 Safari/537.36',
87
88
  },
88
89
  event: {
@@ -245,6 +246,8 @@ this functionality.
245
246
 
246
247
  The gem supplies several distinct exception-types:
247
248
 
249
+ * `InvalidInputError` - Raised if an input value is invalid when client-side
250
+ validation is enabled
248
251
  * `RequestFormatError` - Raised if an unknown key is provided to the
249
252
  `Minfraud::Assessments` constructor
250
253
  * `ClientError` - Raised if the IP address is absent, reserved, or the JSON
@@ -273,7 +276,7 @@ Please report all issues with this code using the
273
276
 
274
277
  If you are having an issue with the minFraud service that is not specific
275
278
  to the client API, please see
276
- [our support page](https://www.maxmind.com/en/support).
279
+ [our support page](https://support.maxmind.com/knowledge-base).
277
280
 
278
281
  ## Requirements
279
282
 
@@ -285,7 +288,7 @@ Bug reports and pull requests are welcome on
285
288
  [GitHub](https://github.com/maxmind/minfraud-api-ruby). This project is
286
289
  intended to be a safe, welcoming space for collaboration, and contributors
287
290
  are expected to adhere to the [Contributor
288
- Covenant](https://contributor-covenant.org) code of conduct.
291
+ Covenant](https://www.contributor-covenant.org/) code of conduct.
289
292
 
290
293
  ## Versioning
291
294
 
@@ -295,10 +298,10 @@ This API uses [Semantic Versioning](https://semver.org/).
295
298
 
296
299
  Copyright (c) 2016-2020 kushnir.yb.
297
300
 
298
- Copyright (c) 2020-2025 MaxMind, Inc.
301
+ Copyright (c) 2020-2026 MaxMind, Inc.
299
302
 
300
303
  The gem is available as open source under the terms of the [MIT
301
- License](https://opensource.org/licenses/MIT).
304
+ License](https://opensource.org/license/MIT).
302
305
 
303
306
  ## Thank You
304
307
 
@@ -4,7 +4,7 @@ module Minfraud
4
4
  # Assessments is used to perform minFraud Score, Insights, and Factors
5
5
  # requests.
6
6
  #
7
- # @see https://dev.maxmind.com/minfraud?lang=en
7
+ # @see https://dev.maxmind.com/minfraud/?lang=en
8
8
  class Assessments
9
9
  include ::Minfraud::Resolver
10
10
 
@@ -4,7 +4,7 @@ module Minfraud
4
4
  module Components
5
5
  # Account corresponds to the account object of a minFraud request.
6
6
  #
7
- # @see https://dev.maxmind.com/minfraud/api-documentation/requests?lang=en#schema--request--account
7
+ # @see https://dev.maxmind.com/minfraud/api-documentation/requests/?lang=en#schema--request--account
8
8
  class Account < Base
9
9
  include Minfraud::Validates
10
10
 
@@ -1,6 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Minfraud
4
+ # Components are used to build the request to the minFraud services.
5
+ # Each component represents a part of the transaction being analyzed,
6
+ # such as the device, account, email, or billing address.
4
7
  module Components
5
8
  # This is a parent class for all components. It defines a method which is
6
9
  # used for basic JSON representation of the component objects.
@@ -4,7 +4,7 @@ module Minfraud
4
4
  module Components
5
5
  # Billing corresponds to the billing object of a minFraud request.
6
6
  #
7
- # @see https://dev.maxmind.com/minfraud/api-documentation/requests?lang=en#schema--request--billing
7
+ # @see https://dev.maxmind.com/minfraud/api-documentation/requests/?lang=en#schema--request--billing
8
8
  class Billing < Addressable; end
9
9
  end
10
10
  end
@@ -4,7 +4,7 @@ module Minfraud
4
4
  module Components
5
5
  # CreditCard corresponds to the credit_card object of a minFraud request.
6
6
  #
7
- # @see https://dev.maxmind.com/minfraud/api-documentation/requests?lang=en#schema--request--credit-card
7
+ # @see https://dev.maxmind.com/minfraud/api-documentation/requests/?lang=en#schema--request--credit-card
8
8
  class CreditCard < Base
9
9
  include Minfraud::Validates
10
10
 
@@ -14,9 +14,10 @@ module Minfraud
14
14
  # @return [String, nil]
15
15
  attr_accessor :issuer_id_number
16
16
 
17
- # The last two or four digits of the credit card number.
17
+ # The last two or four digits of the credit card number. In most cases,
18
+ # you should send the last four digits for +last_digits+.
18
19
  #
19
- # @see https://dev.maxmind.com/minfraud/api-documentation/requests?lang=en#schema--request--credit-card__last_digits
20
+ # @see https://dev.maxmind.com/minfraud/api-documentation/requests/?lang=en#schema--request--credit-card__last_digits
20
21
  #
21
22
  # @return [String, nil]
22
23
  attr_accessor :last_digits
@@ -42,7 +43,7 @@ module Minfraud
42
43
  attr_accessor :bank_phone_number
43
44
 
44
45
  # The two character ISO 3166-1 alpha-2 country code where the issuer of
45
- # the card is located. This may be passed instead of {::issuer_id_number}
46
+ # the card is located. This may be passed instead of {#issuer_id_number}
46
47
  # if you do not wish to pass partial account numbers, or if your payment
47
48
  # processor does not provide them.
48
49
  #
@@ -74,7 +75,7 @@ module Minfraud
74
75
  # @return [String, nil]
75
76
  attr_accessor :cvv_result
76
77
 
77
- # Whether the outcome of 3-D Secure verification (e.g. Safekey,
78
+ # Whether the outcome of 3-D Secure verification (e.g. SafeKey,
78
79
  # SecureCode, Verified by Visa) was successful. +true+ if customer
79
80
  # verification was successful, or +false+ if the customer failed
80
81
  # verification. If 3-D Secure verification was not used, was unavailable,
@@ -86,7 +87,7 @@ module Minfraud
86
87
 
87
88
  # Get the last digits of the credit card number.
88
89
  #
89
- # @deprecated Use {::last_digits} instead.
90
+ # @deprecated Use {#last_digits} instead.
90
91
  #
91
92
  # @return [String, nil]
92
93
  def last_4_digits
@@ -95,7 +96,7 @@ module Minfraud
95
96
 
96
97
  # Set the last digits of the credit card number.
97
98
  #
98
- # @deprecated Use {::last_digits} instead.
99
+ # @deprecated Use {#last_digits} instead.
99
100
  #
100
101
  # @return [String, nil]
101
102
  def last_4_digits=(last4)
@@ -5,7 +5,7 @@ module Minfraud
5
5
  # CustomInputs corresponds to the custom_inputs object of a minFraud
6
6
  # request.
7
7
  #
8
- # @see https://dev.maxmind.com/minfraud/api-documentation/requests?lang=en#schema--request--custom-inputs
8
+ # @see https://dev.maxmind.com/minfraud/api-documentation/requests/?lang=en#schema--request--custom-inputs
9
9
  class CustomInputs < Base
10
10
  include Minfraud::Validates
11
11
 
@@ -4,7 +4,7 @@ module Minfraud
4
4
  module Components
5
5
  # Device corresponds to the device object of a minFraud request.
6
6
  #
7
- # @see https://dev.maxmind.com/minfraud/api-documentation/requests?lang=en#schema--request--device
7
+ # @see https://dev.maxmind.com/minfraud/api-documentation/requests/?lang=en#schema--request--device
8
8
  class Device < Base
9
9
  include Minfraud::Validates
10
10
 
@@ -40,6 +40,12 @@ module Minfraud
40
40
  # @return [String, nil]
41
41
  attr_accessor :session_id
42
42
 
43
+ # The token generated by the Device Tracking Add-on for explicit
44
+ # device linking.
45
+ #
46
+ # @return [String, nil]
47
+ attr_accessor :tracking_token
48
+
43
49
  # @param params [Hash] Hash of parameters. Each key/value should
44
50
  # correspond to one of the available attributes.
45
51
  def initialize(params = {})
@@ -48,6 +54,7 @@ module Minfraud
48
54
  @accept_language = params[:accept_language]
49
55
  @session_age = params[:session_age]
50
56
  @session_id = params[:session_id]
57
+ @tracking_token = params[:tracking_token]
51
58
 
52
59
  validate
53
60
  end
@@ -7,7 +7,7 @@ module Minfraud
7
7
  module Components
8
8
  # Email corresponds to the email object of a minFraud request.
9
9
  #
10
- # @see https://dev.maxmind.com/minfraud/api-documentation/requests?lang=en#schema--request--email
10
+ # @see https://dev.maxmind.com/minfraud/api-documentation/requests/?lang=en#email
11
11
  class Email < Base
12
12
  include Minfraud::Validates
13
13
 
@@ -4,7 +4,7 @@ module Minfraud
4
4
  module Components
5
5
  # Event corresponds to the event object of a minFraud request.
6
6
  #
7
- # @see https://dev.maxmind.com/minfraud/api-documentation/requests?lang=en#schema--request--event
7
+ # @see https://dev.maxmind.com/minfraud/api-documentation/requests/?lang=en#schema--request--event
8
8
  class Event < Base
9
9
  include ::Minfraud::Enum
10
10
  include Minfraud::Validates
@@ -38,10 +38,10 @@ module Minfraud
38
38
 
39
39
  # The date and time the event occurred. The string must be in the RFC
40
40
  # 3339 date-time format, e.g., "2012-04-12T23:20:50.52Z". The time must
41
- # be within the past 10 years. If this field is not in the request, the
41
+ # be within the past year. If this field is not in the request, the
42
42
  # current time will be used.
43
43
  #
44
- # @see https://tools.ietf.org/html/rfc3339
44
+ # @see https://datatracker.ietf.org/doc/html/rfc3339
45
45
  #
46
46
  # @return [String, nil]
47
47
  attr_accessor :time
@@ -4,12 +4,12 @@ module Minfraud
4
4
  module Components
5
5
  # Order corresponds to the order object of a minFraud request.
6
6
  #
7
- # @see https://dev.maxmind.com/minfraud/api-documentation/requests?lang=en#schema--request--order
7
+ # @see https://dev.maxmind.com/minfraud/api-documentation/requests/?lang=en#schema--request--order
8
8
  class Order < Base
9
9
  include Minfraud::Validates
10
10
 
11
11
  # The total order amount for the transaction before taxes and discounts.
12
- # The value must be at least 0 and at most 1e14 - 1.
12
+ # The value must be at least 0 and at most 1e13 - 1.
13
13
  #
14
14
  # @return [Float, nil]
15
15
  attr_accessor :amount
@@ -4,7 +4,7 @@ module Minfraud
4
4
  module Components
5
5
  # Payment corresponds to the payment object of a minFraud request.
6
6
  #
7
- # @see https://dev.maxmind.com/minfraud/api-documentation/requests?lang=en#schema--request--payment
7
+ # @see https://dev.maxmind.com/minfraud/api-documentation/requests/?lang=en#schema--request--payment
8
8
  class Payment < Base
9
9
  include ::Minfraud::Enum
10
10
  include Minfraud::Validates
@@ -48,6 +48,7 @@ module Minfraud
48
48
  aps_payments
49
49
  authorizenet
50
50
  balanced
51
+ banquest
51
52
  beanstream
52
53
  bluepay
53
54
  bluesnap
@@ -96,6 +97,7 @@ module Minfraud
96
97
  epx
97
98
  eway
98
99
  exact
100
+ fat_zebra
99
101
  first_atlantic_commerce
100
102
  first_data
101
103
  fiserv
@@ -179,6 +181,7 @@ module Minfraud
179
181
  solidtrust_pay
180
182
  sps_decidir
181
183
  stripe
184
+ summit_payments
182
185
  synapsefi
183
186
  systempay
184
187
  telerecargas
@@ -198,6 +201,7 @@ module Minfraud
198
201
  windcave
199
202
  wirecard
200
203
  worldpay
204
+ yaadpay
201
205
  ]
202
206
 
203
207
  # The authorization outcome from the payment processor. If the
@@ -2,10 +2,11 @@
2
2
 
3
3
  module Minfraud
4
4
  module Components
5
+ # Components for the Report Transaction API.
5
6
  module Report
6
7
  # Contains the fields used in the Report Transaction API.
7
8
  #
8
- # @see https://dev.maxmind.com/minfraud/report-a-transaction?lang=en
9
+ # @see https://dev.maxmind.com/minfraud/report-a-transaction/?lang=en
9
10
  class Transaction < Base
10
11
  include ::Minfraud::Enum
11
12
  include ::Minfraud::Validates
@@ -22,13 +23,13 @@ module Minfraud
22
23
  # A symbol indicating the likelihood that a transaction may be
23
24
  # fraudulent.
24
25
  #
25
- # This may be one of +:chargeback+, +:not_fraud+, +:spam_or_abuse+, or
26
- # +:suspected_fraud+.
26
+ # This may be one of +:chargeback+, +:clear+ (to retract a previous
27
+ # report), +:not_fraud+, +:spam_or_abuse+, or +:suspected_fraud+.
27
28
  #
28
29
  # @!attribute tag
29
30
  #
30
31
  # @return [Symbol, nil]
31
- enum_accessor :tag, %i[chargeback not_fraud spam_or_abuse suspected_fraud]
32
+ enum_accessor :tag, %i[chargeback clear not_fraud spam_or_abuse suspected_fraud]
32
33
 
33
34
  # A string which is provided by your payment processor indicating the
34
35
  # reason for the chargeback.
@@ -4,7 +4,7 @@ module Minfraud
4
4
  module Components
5
5
  # Shipping corresponds to the shipping object of a minFraud request.
6
6
  #
7
- # @see https://dev.maxmind.com/minfraud/api-documentation/requests?lang=en#schema--request--shipping
7
+ # @see https://dev.maxmind.com/minfraud/api-documentation/requests/?lang=en#schema--request--shipping
8
8
  class Shipping < Addressable
9
9
  include ::Minfraud::Enum
10
10
 
@@ -5,7 +5,7 @@ module Minfraud
5
5
  # ShoppingCart corresponds to the shopping_cart object of a minFraud
6
6
  # request.
7
7
  #
8
- # @see https://dev.maxmind.com/minfraud/api-documentation/requests?lang=en#schema--request--shopping-cart
8
+ # @see https://dev.maxmind.com/minfraud/api-documentation/requests/?lang=en#schema--request--shopping-cart
9
9
  class ShoppingCart < Base
10
10
  # An array of Minfraud::Components::ShoppingCartItem instances.
11
11
  #
@@ -5,20 +5,20 @@ module Minfraud
5
5
  # ShoppingCartItem corresponds to objects in the shopping_cart object
6
6
  # of a minFraud request.
7
7
  #
8
- # @see https://dev.maxmind.com/minfraud/api-documentation/requests?lang=en#schema--request--shopping-cart--item
8
+ # @see https://dev.maxmind.com/minfraud/api-documentation/requests/?lang=en#schema--request--shopping-cart
9
9
  class ShoppingCartItem < Base
10
10
  include Minfraud::Validates
11
11
 
12
12
  # The category of the item. This can also be a hashed value; see link.
13
13
  #
14
- # @see https://dev.maxmind.com/minfraud/api-documentation/requests?lang=en#schema--request--shopping-cart--item__category
14
+ # @see https://dev.maxmind.com/minfraud/api-documentation/requests/?lang=en#schema--request--shopping-cart__category
15
15
  #
16
16
  # @return [String, nil]
17
17
  attr_accessor :category
18
18
 
19
19
  # The internal ID of the item. This can also be a hashed value; see link.
20
20
  #
21
- # @see https://dev.maxmind.com/minfraud/api-documentation/requests?lang=en#schema--request--shopping-cart--item__item_id
21
+ # @see https://dev.maxmind.com/minfraud/api-documentation/requests/?lang=en#schema--request--shopping-cart__item_id
22
22
  #
23
23
  # @return [String, nil]
24
24
  attr_accessor :item_id
@@ -31,7 +31,7 @@ module Minfraud
31
31
 
32
32
  # The per-unit price of this item in the shopping cart. This should use
33
33
  # the same currency as the order currency. The value must be at least 0
34
- # and at most 1e14 - 1.
34
+ # and at most 1e13 - 1.
35
35
  #
36
36
  # @return [Float, nil]
37
37
  attr_accessor :price
data/lib/minfraud/enum.rb CHANGED
@@ -3,6 +3,12 @@
3
3
  module Minfraud
4
4
  # Enum provides helpers for working with attributes with enumerated types.
5
5
  module Enum
6
+ # Hook method called when the module is included into a class.
7
+ # Extends the class with ClassMethods.
8
+ #
9
+ # @param base [Class] The class including this module.
10
+ #
11
+ # @return [Class] The base class.
6
12
  def self.included(base)
7
13
  base.extend(ClassMethods)
8
14
  end
@@ -7,18 +7,20 @@ require 'minfraud/model/insights'
7
7
  require 'minfraud/model/score'
8
8
 
9
9
  module Minfraud
10
+ # HTTPService contains classes for handling HTTP communication with the
11
+ # minFraud web services.
10
12
  module HTTPService
11
13
  # Response class for HTTP requests.
12
14
  class Response
13
15
  # Response HTTP status code.
14
16
  #
15
- # @return [Fixnum, nil]
17
+ # @return [Integer, nil]
16
18
  attr_reader :status
17
19
 
18
20
  # Response model.
19
21
  #
20
22
  # @return [Minfraud::Model::Score, Minfraud::Model::Insights,
21
- # Minfraud::Model::Factors, nil]
23
+ # Minfraud::Model::Factors, Minfraud::Model::Error, nil]
22
24
  attr_reader :body
23
25
 
24
26
  # @param endpoint [Symbol, nil] endpoint name, like :score.
@@ -1,6 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Minfraud
4
+ # Model contains classes for the minFraud response data. These classes
5
+ # represent the data returned by the Score, Insights, and Factors
6
+ # endpoints.
4
7
  module Model
5
8
  # @!visibility private
6
9
  class Abstract
@@ -8,7 +8,7 @@ module Minfraud
8
8
  #
9
9
  # In order to receive device output from minFraud Insights or minFraud
10
10
  # Factors, you must be using the Device Tracking Add-on
11
- # (https://dev.maxmind.com/minfraud/track-devices?lang=en).
11
+ # (https://dev.maxmind.com/minfraud/track-devices/?lang=en).
12
12
  class Device < Abstract
13
13
  # This number represents our confidence that the device_id refers to a
14
14
  # unique device as opposed to a cluster of similar devices. A confidence
@@ -14,7 +14,8 @@ module Minfraud
14
14
 
15
15
  # A date string (e.g. 2017-04-24) to identify the date an email address
16
16
  # was first seen by MaxMind. This is expressed using the ISO 8601 date
17
- # format.
17
+ # format YYYY-MM-DD. The earliest date that may be returned is January
18
+ # 1, 2008.
18
19
  #
19
20
  # @return [String, nil]
20
21
  attr_reader :first_seen
@@ -16,9 +16,10 @@ module Minfraud
16
16
  # @return [String, nil]
17
17
  attr_reader :classification
18
18
 
19
- # A date string (e.g. 2017-04-24) to identify the date an email domain
19
+ # A date string (e.g. 2019-01-01) to identify the date an email domain
20
20
  # was first seen by MaxMind. This is expressed using the ISO 8601 date
21
- # format.
21
+ # format YYYY-MM-DD. The earliest date that may be returned is January
22
+ # 1, 2019.
22
23
  #
23
24
  # @return [String, nil]
24
25
  attr_reader :first_seen
@@ -7,7 +7,9 @@ module Minfraud
7
7
  # Model containing information about an automated visit to the email
8
8
  # domain.
9
9
  class EmailDomainVisit < Abstract
10
- # Whether the domain redirects to another URL.
10
+ # This is true if the domain in the request has redirects (configured
11
+ # to automatically send visitors to another URL). Otherwise, this will
12
+ # be nil.
11
13
  #
12
14
  # @return [Boolean, nil]
13
15
  attr_reader :has_redirect
@@ -19,12 +21,13 @@ module Minfraud
19
21
  attr_reader :last_visited_on
20
22
 
21
23
  # The status of the domain. Possible values are:
22
- # * live - The domain is operational and serving content.
23
- # * dns_error - The domain has missing, expired, or misconfigured DNS.
24
- # * network_error - The domain is offline or unreachable.
25
- # * http_error - The domain is reachable, but has an application error.
26
- # * parked - The domain is reachable and in a parked state.
27
- # * pre_development - The domain is reachable and in a pre-development
24
+ # * live - The domain is reachable and serving content normally.
25
+ # * dns_error - The domain is missing, expired, or DNS is misconfigured.
26
+ # * network_error - The domain is offline, blocked, or unreachable.
27
+ # * http_error - The domain is reachable but the web application had a
28
+ # problem or denied the request.
29
+ # * parked - The domain is live and is in a parked state.
30
+ # * pre_development - The domain is live and is in a pre-development
28
31
  # state.
29
32
  #
30
33
  # @return [String, nil]
@@ -21,7 +21,7 @@ module Minfraud
21
21
  # that are used to calculate the overall risk score.
22
22
  #
23
23
  # @return [Minfraud::Model::Subscores]
24
- # @deprecated Use {::risk_score_reasons} instead.
24
+ # @deprecated Use {#risk_score_reasons} instead.
25
25
  attr_reader :subscores
26
26
 
27
27
  # @!visibility private
@@ -4,7 +4,7 @@ require 'maxmind/geoip2/record/location'
4
4
 
5
5
  module Minfraud
6
6
  module Model
7
- # Model of the GeoIP2 location information, including the local time.
7
+ # Model of the GeoIP location information, including the local time.
8
8
  class GeoIP2Location < MaxMind::GeoIP2::Record::Location
9
9
  # The date and time of the transaction in the time zone associated with
10
10
  # the IP address. The value is formatted according to RFC 3339. For
@@ -43,7 +43,7 @@ module Minfraud
43
43
  # @return [Minfraud::Model::Email]
44
44
  attr_reader :email
45
45
 
46
- # An object containing GeoIP2 and minFraud Insights information about the
46
+ # An object containing GeoIP and minFraud Insights information about the
47
47
  # geolocated IP address.
48
48
  #
49
49
  # @return [Minfraud::Model::IPAddress]
@@ -6,7 +6,7 @@ require 'minfraud/model/ip_risk_reason'
6
6
 
7
7
  module Minfraud
8
8
  module Model
9
- # Model containing GeoIP2 data and the risk for the IP address.
9
+ # Model containing GeoIP data and the risk for the IP address.
10
10
  class IPAddress < MaxMind::GeoIP2::Model::Insights
11
11
  # This field contains the risk associated with the IP address. The value
12
12
  # ranges from 0.01 to 99. A higher score indicates a higher risk.
@@ -8,7 +8,7 @@ module Minfraud
8
8
  #
9
9
  # This class provides both a machine-readable code and a human-readable
10
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.
11
+ # https://dev.maxmind.com/minfraud/api-documentation/responses/#schema--response--risk-score-reason--multiplier-reason.
12
12
  # Although more codes may be added in the future, the current codes are:
13
13
  #
14
14
  # * BROWSER_LANGUAGE - Riskiness of the browser user-agent and
@@ -6,7 +6,7 @@ module Minfraud
6
6
  module Model
7
7
  # Model containing information about the shipping address.
8
8
  class ShippingAddress < Address
9
- # The distance in kilometers from the shipping address to billing
9
+ # The distance in kilometers from the shipping address to the billing
10
10
  # address.
11
11
  #
12
12
  # @return [Integer, nil]
@@ -16,6 +16,8 @@ module Minfraud
16
16
  # with fraudulent transactions. The field is false when the address is
17
17
  # not associated with increased risk. The key will only be present when a
18
18
  # shipping address is provided.
19
+ #
20
+ # @return [Boolean, nil]
19
21
  attr_reader :is_high_risk
20
22
 
21
23
  # @!visibility private