From 476cefadc04b994aa71cb99e8111488ce027de0f Mon Sep 17 00:00:00 2001 From: William Storey Date: Thu, 15 Jan 2026 14:10:32 -0800 Subject: [PATCH 01/14] Fix README documentation issues * Fixed code fence with extra backtick * Corrected response class name to Minfraud::HTTPService::Response * Added missing InvalidInputError to exceptions list * Updated copyright year to 2026 Co-Authored-By: Claude Opus 4.5 --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d543ac7..2d13359 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Minfraud.configure do |c| c.license_key = 'your_license_key' c.enable_validation = true end -```` +``` To use the Sandbox web service instead of the production web service, you can provide the host: @@ -69,8 +69,8 @@ creating the object. After populating the object, call the method for the minFraud endpoint you want to use: `#score`, `#insights`, or `#factors`. The returned value is a -`MinFraud::Response` object. You can access the response model through its -`#body` attribute. +`Minfraud::HTTPService::Response` object. You can access the response model +through its `#body` attribute. An exception will be thrown for critical errors. You should check for `warnings` related to your inputs after a request. @@ -245,6 +245,8 @@ this functionality. The gem supplies several distinct exception-types: +* `InvalidInputError` - Raised if an input value is invalid when client-side + validation is enabled * `RequestFormatError` - Raised if an unknown key is provided to the `Minfraud::Assessments` constructor * `ClientError` - Raised if the IP address is absent, reserved, or the JSON @@ -295,7 +297,7 @@ This API uses [Semantic Versioning](https://semver.org/). Copyright (c) 2016-2020 kushnir.yb. -Copyright (c) 2020-2025 MaxMind, Inc. +Copyright (c) 2020-2026 MaxMind, Inc. The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). From a2bb3b4a488e9f5be37939ce0c75bd2659a6a56a Mon Sep 17 00:00:00 2001 From: William Storey Date: Thu, 15 Jan 2026 14:18:20 -0800 Subject: [PATCH 02/14] Fix CreditCard component documentation * Added guidance to send last four digits for last_digits field * Fixed YARD link syntax for instance attribute references * Fixed SafeKey capitalization Co-Authored-By: Claude Opus 4.5 --- lib/minfraud/components/credit_card.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/minfraud/components/credit_card.rb b/lib/minfraud/components/credit_card.rb index f1aacff..d990d09 100644 --- a/lib/minfraud/components/credit_card.rb +++ b/lib/minfraud/components/credit_card.rb @@ -14,7 +14,8 @@ class CreditCard < Base # @return [String, nil] attr_accessor :issuer_id_number - # The last two or four digits of the credit card number. + # The last two or four digits of the credit card number. In most cases, + # you should send the last four digits for +last_digits+. # # @see https://dev.maxmind.com/minfraud/api-documentation/requests?lang=en#schema--request--credit-card__last_digits # @@ -42,7 +43,7 @@ class CreditCard < Base attr_accessor :bank_phone_number # The two character ISO 3166-1 alpha-2 country code where the issuer of - # the card is located. This may be passed instead of {::issuer_id_number} + # the card is located. This may be passed instead of {#issuer_id_number} # if you do not wish to pass partial account numbers, or if your payment # processor does not provide them. # @@ -74,7 +75,7 @@ class CreditCard < Base # @return [String, nil] attr_accessor :cvv_result - # Whether the outcome of 3-D Secure verification (e.g. Safekey, + # Whether the outcome of 3-D Secure verification (e.g. SafeKey, # SecureCode, Verified by Visa) was successful. +true+ if customer # verification was successful, or +false+ if the customer failed # verification. If 3-D Secure verification was not used, was unavailable, @@ -86,7 +87,7 @@ class CreditCard < Base # Get the last digits of the credit card number. # - # @deprecated Use {::last_digits} instead. + # @deprecated Use {#last_digits} instead. # # @return [String, nil] def last_4_digits @@ -95,7 +96,7 @@ def last_4_digits # Set the last digits of the credit card number. # - # @deprecated Use {::last_digits} instead. + # @deprecated Use {#last_digits} instead. # # @return [String, nil] def last_4_digits=(last4) From 995401964de47e0c16e432852a7273ea03bf6ad0 Mon Sep 17 00:00:00 2001 From: William Storey Date: Thu, 15 Jan 2026 14:20:01 -0800 Subject: [PATCH 03/14] Fix Email component documentation URL Co-Authored-By: Claude Opus 4.5 --- lib/minfraud/components/email.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/minfraud/components/email.rb b/lib/minfraud/components/email.rb index b79c26a..cdd9054 100644 --- a/lib/minfraud/components/email.rb +++ b/lib/minfraud/components/email.rb @@ -7,7 +7,7 @@ module Minfraud module Components # Email corresponds to the email object of a minFraud request. # - # @see https://dev.maxmind.com/minfraud/api-documentation/requests?lang=en#schema--request--email + # @see https://dev.maxmind.com/minfraud/api-documentation/requests/?lang=en#email class Email < Base include Minfraud::Validates From 46f92350d9ed7b302d73fb086188841bba4c5e08 Mon Sep 17 00:00:00 2001 From: William Storey Date: Thu, 15 Jan 2026 14:22:23 -0800 Subject: [PATCH 04/14] Fix component documentation * Fixed event time constraint from 10 years to 1 year * Fixed max value from 1e14 to 1e13 for order amount and cart item price * Fixed shopping cart documentation URLs Co-Authored-By: Claude Opus 4.5 --- lib/minfraud/components/event.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/minfraud/components/event.rb b/lib/minfraud/components/event.rb index 9417351..2cb8ee0 100644 --- a/lib/minfraud/components/event.rb +++ b/lib/minfraud/components/event.rb @@ -38,7 +38,7 @@ class Event < Base # The date and time the event occurred. The string must be in the RFC # 3339 date-time format, e.g., "2012-04-12T23:20:50.52Z". The time must - # be within the past 10 years. If this field is not in the request, the + # be within the past year. If this field is not in the request, the # current time will be used. # # @see https://tools.ietf.org/html/rfc3339 From 04564af8c5908f817989419b8cfda10fc63a1039 Mon Sep 17 00:00:00 2001 From: William Storey Date: Thu, 15 Jan 2026 14:22:49 -0800 Subject: [PATCH 05/14] Fix order amount max value in documentation Co-Authored-By: Claude Opus 4.5 --- lib/minfraud/components/order.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/minfraud/components/order.rb b/lib/minfraud/components/order.rb index e7d1eac..1a264b2 100644 --- a/lib/minfraud/components/order.rb +++ b/lib/minfraud/components/order.rb @@ -9,7 +9,7 @@ class Order < Base include Minfraud::Validates # The total order amount for the transaction before taxes and discounts. - # The value must be at least 0 and at most 1e14 - 1. + # The value must be at least 0 and at most 1e13 - 1. # # @return [Float, nil] attr_accessor :amount From 34158a7195f757b7fd8621befd7371460dfe144f Mon Sep 17 00:00:00 2001 From: William Storey Date: Thu, 15 Jan 2026 14:23:18 -0800 Subject: [PATCH 06/14] Fix ShoppingCartItem documentation * Fixed documentation URLs * Fixed price max value from 1e14 to 1e13 Co-Authored-By: Claude Opus 4.5 --- lib/minfraud/components/shopping_cart_item.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/minfraud/components/shopping_cart_item.rb b/lib/minfraud/components/shopping_cart_item.rb index 8a70d24..76462d1 100644 --- a/lib/minfraud/components/shopping_cart_item.rb +++ b/lib/minfraud/components/shopping_cart_item.rb @@ -5,20 +5,20 @@ module Components # ShoppingCartItem corresponds to objects in the shopping_cart object # of a minFraud request. # - # @see https://dev.maxmind.com/minfraud/api-documentation/requests?lang=en#schema--request--shopping-cart--item + # @see https://dev.maxmind.com/minfraud/api-documentation/requests?lang=en#schema--request--shopping-cart class ShoppingCartItem < Base include Minfraud::Validates # The category of the item. This can also be a hashed value; see link. # - # @see https://dev.maxmind.com/minfraud/api-documentation/requests?lang=en#schema--request--shopping-cart--item__category + # @see https://dev.maxmind.com/minfraud/api-documentation/requests/?lang=en#schema--request--shopping-cart__category # # @return [String, nil] attr_accessor :category # The internal ID of the item. This can also be a hashed value; see link. # - # @see https://dev.maxmind.com/minfraud/api-documentation/requests?lang=en#schema--request--shopping-cart--item__item_id + # @see https://dev.maxmind.com/minfraud/api-documentation/requests/?lang=en#schema--request--shopping-cart__item_id # # @return [String, nil] attr_accessor :item_id @@ -31,7 +31,7 @@ class ShoppingCartItem < Base # The per-unit price of this item in the shopping cart. This should use # the same currency as the order currency. The value must be at least 0 - # and at most 1e14 - 1. + # and at most 1e13 - 1. # # @return [Float, nil] attr_accessor :price From b9750bac8bb361bb0efc132bfbf9dde0b5910f39 Mon Sep 17 00:00:00 2001 From: William Storey Date: Thu, 15 Jan 2026 14:24:30 -0800 Subject: [PATCH 07/14] Fix Response documentation * Changed Fixnum to Integer (Fixnum deprecated in Ruby 2.4+) * Added Minfraud::Model::Error to body return types Co-Authored-By: Claude Opus 4.5 --- lib/minfraud/http_service/response.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/minfraud/http_service/response.rb b/lib/minfraud/http_service/response.rb index 98d89d5..9e7a437 100644 --- a/lib/minfraud/http_service/response.rb +++ b/lib/minfraud/http_service/response.rb @@ -12,13 +12,13 @@ module HTTPService class Response # Response HTTP status code. # - # @return [Fixnum, nil] + # @return [Integer, nil] attr_reader :status # Response model. # # @return [Minfraud::Model::Score, Minfraud::Model::Insights, - # Minfraud::Model::Factors, nil] + # Minfraud::Model::Factors, Minfraud::Model::Error, nil] attr_reader :body # @param endpoint [Symbol, nil] endpoint name, like :score. From 2fd034488b3323c512abc5d7208834180ec73ba3 Mon Sep 17 00:00:00 2001 From: William Storey Date: Thu, 15 Jan 2026 14:25:25 -0800 Subject: [PATCH 08/14] Document earliest date for email first_seen field Co-Authored-By: Claude Opus 4.5 --- lib/minfraud/model/email.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/minfraud/model/email.rb b/lib/minfraud/model/email.rb index 4bcb091..aa70616 100644 --- a/lib/minfraud/model/email.rb +++ b/lib/minfraud/model/email.rb @@ -14,7 +14,8 @@ class Email < Abstract # A date string (e.g. 2017-04-24) to identify the date an email address # was first seen by MaxMind. This is expressed using the ISO 8601 date - # format. + # format YYYY-MM-DD. The earliest date that may be returned is January + # 1, 2008. # # @return [String, nil] attr_reader :first_seen From 6e0b845d42c8a6d053d3f2220c0af3ef29a5762c Mon Sep 17 00:00:00 2001 From: William Storey Date: Thu, 15 Jan 2026 14:26:07 -0800 Subject: [PATCH 09/14] Document earliest date for email domain first_seen field Co-Authored-By: Claude Opus 4.5 --- lib/minfraud/model/email_domain.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/minfraud/model/email_domain.rb b/lib/minfraud/model/email_domain.rb index 1e4c0d8..f54d579 100644 --- a/lib/minfraud/model/email_domain.rb +++ b/lib/minfraud/model/email_domain.rb @@ -16,9 +16,10 @@ class EmailDomain < Abstract # @return [String, nil] attr_reader :classification - # A date string (e.g. 2017-04-24) to identify the date an email domain + # A date string (e.g. 2019-01-01) to identify the date an email domain # was first seen by MaxMind. This is expressed using the ISO 8601 date - # format. + # format YYYY-MM-DD. The earliest date that may be returned is January + # 1, 2019. # # @return [String, nil] attr_reader :first_seen From f68f69152ad80ff48f5cb770219b231b1deea2c0 Mon Sep 17 00:00:00 2001 From: William Storey Date: Thu, 15 Jan 2026 14:27:19 -0800 Subject: [PATCH 10/14] Improve EmailDomainVisit documentation * Clarified has_redirect description * Updated status value descriptions for accuracy Co-Authored-By: Claude Opus 4.5 --- lib/minfraud/model/email_domain_visit.rb | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/minfraud/model/email_domain_visit.rb b/lib/minfraud/model/email_domain_visit.rb index 2211785..c842246 100644 --- a/lib/minfraud/model/email_domain_visit.rb +++ b/lib/minfraud/model/email_domain_visit.rb @@ -7,7 +7,9 @@ module Model # Model containing information about an automated visit to the email # domain. class EmailDomainVisit < Abstract - # Whether the domain redirects to another URL. + # This is true if the domain in the request has redirects (configured + # to automatically send visitors to another URL). Otherwise, this will + # be nil. # # @return [Boolean, nil] attr_reader :has_redirect @@ -19,12 +21,13 @@ class EmailDomainVisit < Abstract attr_reader :last_visited_on # The status of the domain. Possible values are: - # * live - The domain is operational and serving content. - # * dns_error - The domain has missing, expired, or misconfigured DNS. - # * network_error - The domain is offline or unreachable. - # * http_error - The domain is reachable, but has an application error. - # * parked - The domain is reachable and in a parked state. - # * pre_development - The domain is reachable and in a pre-development + # * live - The domain is reachable and serving content normally. + # * dns_error - The domain is missing, expired, or DNS is misconfigured. + # * network_error - The domain is offline, blocked, or unreachable. + # * http_error - The domain is reachable but the web application had a + # problem or denied the request. + # * parked - The domain is live and is in a parked state. + # * pre_development - The domain is live and is in a pre-development # state. # # @return [String, nil] From f60ec7037a29069f445f34d9c05be39618597a72 Mon Sep 17 00:00:00 2001 From: William Storey Date: Thu, 15 Jan 2026 14:27:42 -0800 Subject: [PATCH 11/14] Fix YARD link syntax in Factors model Co-Authored-By: Claude Opus 4.5 --- lib/minfraud/model/factors.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/minfraud/model/factors.rb b/lib/minfraud/model/factors.rb index 0c25e5a..e343da9 100644 --- a/lib/minfraud/model/factors.rb +++ b/lib/minfraud/model/factors.rb @@ -21,7 +21,7 @@ class Factors < Insights # that are used to calculate the overall risk score. # # @return [Minfraud::Model::Subscores] - # @deprecated Use {::risk_score_reasons} instead. + # @deprecated Use {#risk_score_reasons} instead. attr_reader :subscores # @!visibility private From 476a4f01f959cd96eaace99678ed9009d60033f4 Mon Sep 17 00:00:00 2001 From: William Storey Date: Thu, 15 Jan 2026 14:28:08 -0800 Subject: [PATCH 12/14] Fix ShippingAddress documentation * Fixed grammar in distance_to_billing_address description * Added missing @return tag for is_high_risk Co-Authored-By: Claude Opus 4.5 --- lib/minfraud/model/shipping_address.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/minfraud/model/shipping_address.rb b/lib/minfraud/model/shipping_address.rb index 0e5b3f9..2fd64ee 100644 --- a/lib/minfraud/model/shipping_address.rb +++ b/lib/minfraud/model/shipping_address.rb @@ -6,7 +6,7 @@ module Minfraud module Model # Model containing information about the shipping address. class ShippingAddress < Address - # The distance in kilometers from the shipping address to billing + # The distance in kilometers from the shipping address to the billing # address. # # @return [Integer, nil] @@ -16,6 +16,8 @@ class ShippingAddress < Address # with fraudulent transactions. The field is false when the address is # not associated with increased risk. The key will only be present when a # shipping address is provided. + # + # @return [Boolean, nil] attr_reader :is_high_risk # @!visibility private From 3c61b8da3d5d4f972f50c1b5581860ac4aa255b7 Mon Sep 17 00:00:00 2001 From: William Storey Date: Thu, 15 Jan 2026 14:29:18 -0800 Subject: [PATCH 13/14] Add missing warning codes to Warning documentation Added: BILLING_REGION_NOT_FOUND, EMAIL_ADDRESS_UNUSABLE, IP_ADDRESS_INVALID, IP_ADDRESS_RESERVED, SHIPPING_REGION_NOT_FOUND Co-Authored-By: Claude Opus 4.5 --- lib/minfraud/model/warning.rb | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/minfraud/model/warning.rb b/lib/minfraud/model/warning.rb index ab7c113..f67fe40 100644 --- a/lib/minfraud/model/warning.rb +++ b/lib/minfraud/model/warning.rb @@ -17,19 +17,30 @@ module Model # our database. # * BILLING_POSTAL_NOT_FOUND - the billing postal could not be found in our # database. + # * BILLING_REGION_NOT_FOUND - the billing region could not be found in our + # database. + # * EMAIL_ADDRESS_UNUSABLE - the email address entered is likely incorrect + # due to an integration issue. To avoid false positives, it has not been + # used in scoring. # * INPUT_INVALID - the value associated with the key does not meet the # required constraints, e.g., "United States" in a field that requires a # two-letter country code. # * INPUT_UNKNOWN - an unknown key was encountered in the request body. + # * IP_ADDRESS_INVALID - the IP address supplied is not a valid IPv4 or + # IPv6 address. # * IP_ADDRESS_NOT_FOUND - the IP address could not be geolocated. - # * SHIPPING_COUNTRY_MISSING - shipping address information was provided - # without providing a shipping country. + # * IP_ADDRESS_RESERVED - the IP address supplied is in a reserved + # network. # * SHIPPING_CITY_NOT_FOUND - the shipping city could not be found in our # database. + # * SHIPPING_COUNTRY_MISSING - shipping address information was provided + # without providing a shipping country. # * SHIPPING_COUNTRY_NOT_FOUND - the shipping country could not be found in # our database. # * SHIPPING_POSTAL_NOT_FOUND - the shipping postal could not be found in # our database. + # * SHIPPING_REGION_NOT_FOUND - the shipping region could not be found in + # our database. class Warning < Abstract # This value is a machine-readable code identifying the warning. # From f4e8a8c7df91adbba6ef2a700eeaa42b26776509 Mon Sep 17 00:00:00 2001 From: William Storey Date: Thu, 15 Jan 2026 14:29:49 -0800 Subject: [PATCH 14/14] Update copyright year to 2026 Co-Authored-By: Claude Opus 4.5 --- LICENSE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE.txt b/LICENSE.txt index ded7397..66f2136 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,7 +1,7 @@ The MIT License (MIT) Copyright (c) 2016-2020 kushnir.yb -Copyright (c) 2020-2025 MaxMind, Inc. +Copyright (c) 2020-2026 MaxMind, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal