Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
CHANGELOG
=========

3.6.0
3.6.0 (2026-01-20)
------------------

* Added the `anonymizer` property to `MaxMind\MinFraud\Model\IpAddress`. This
contains anonymizer data from the GeoIP2 Insights response, including VPN
detection confidence, provider name, and network last seen date. This was
previously available in the GeoIP2 library but not exposed in minFraud
responses.
* Added `banquest`, `summit_payments`, and `yaadpay` to the payment processor
validation.

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ You should now have the file `composer.phar` in your project directory.
Run in your project root:

```
php composer.phar require maxmind/minfraud:^3.5.0
php composer.phar require maxmind/minfraud:^3.6.0
```

You should now have the files `composer.json` and `composer.lock` as well as
Expand Down
14 changes: 14 additions & 0 deletions src/MinFraud/Model/IpAddress.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace MaxMind\MinFraud\Model;

use GeoIp2\Model\Insights;
use GeoIp2\Record\Anonymizer;
use GeoIp2\Record\City;
use GeoIp2\Record\Continent;
use GeoIp2\Record\Country;
Expand All @@ -18,6 +19,13 @@
*/
class IpAddress implements \JsonSerializable
{
/**
* @var Anonymizer data for the anonymizer status of the requested IP
* address. This object contains information about whether
* the IP address belongs to an anonymous network.
*/
public readonly Anonymizer $anonymizer;

/**
* @var City city data for the requested IP address
*/
Expand Down Expand Up @@ -123,6 +131,7 @@ public function __construct(?array $response, array $locales = ['en'])
$this->representedCountry = $insights->representedCountry;
$this->subdivisions = $insights->subdivisions;
$this->traits = $insights->traits;
$this->anonymizer = $insights->anonymizer;

$this->location = new GeoIp2Location($response['location'] ?? []);
$this->risk = $response['risk'] ?? null;
Expand All @@ -143,6 +152,11 @@ public function jsonSerialize(): ?array
{
$js = [];

$anonymizer = $this->anonymizer->jsonSerialize();
if (!empty($anonymizer)) {
$js['anonymizer'] = $anonymizer;
}

$city = $this->city->jsonSerialize();
if (!empty($city)) {
$js['city'] = $city;
Expand Down
2 changes: 1 addition & 1 deletion src/MinFraud/ServiceClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

abstract class ServiceClient
{
public const VERSION = 'v3.5.0';
public const VERSION = 'v3.6.0';

/**
* @var Client
Expand Down
32 changes: 32 additions & 0 deletions tests/MaxMind/Test/MinFraud/Model/InsightsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,38 @@ public function testInsightsProperties(): void
'correct mobile network code'
);

// Test anonymizer object
foreach ([
'isAnonymous',
'isAnonymousVpn',
'isHostingProvider',
'isPublicProxy',
'isTorExitNode',
] as $property) {
$this->assertTrue(
$insights->ipAddress->anonymizer->{$property},
"anonymizer {$property} is true"
);
}

$this->assertSame(
$array['ip_address']['anonymizer']['confidence'],
$insights->ipAddress->anonymizer->confidence,
'correct anonymizer confidence'
);

$this->assertSame(
$array['ip_address']['anonymizer']['provider_name'],
$insights->ipAddress->anonymizer->providerName,
'correct anonymizer provider name'
);
Comment thread
oschwald marked this conversation as resolved.

$this->assertSame(
$array['ip_address']['anonymizer']['network_last_seen'],
$insights->ipAddress->anonymizer->networkLastSeen,
'correct anonymizer network last seen'
);

$this->assertSame(
$array['billing_phone']['country'],
$insights->billingPhone->country,
Expand Down
10 changes: 10 additions & 0 deletions tests/data/minfraud/factors-response.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,16 @@
"network": "152.216.7.0/24",
"organization": "STONEHOUSE office network",
"user_type": "government"
},
"anonymizer": {
"confidence": 99,
"is_anonymous": true,
"is_anonymous_vpn": true,
"is_hosting_provider": true,
"is_public_proxy": true,
"is_tor_exit_node": true,
"network_last_seen": "2025-01-15",
"provider_name": "TestVPN"
}
},
"billing_address": {
Expand Down
10 changes: 10 additions & 0 deletions tests/data/minfraud/insights-response.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,16 @@
"network": "152.216.7.0/24",
"organization": "STONEHOUSE office network",
"user_type": "government"
},
"anonymizer": {
"confidence": 99,
"is_anonymous": true,
"is_anonymous_vpn": true,
"is_hosting_provider": true,
"is_public_proxy": true,
"is_tor_exit_node": true,
"network_last_seen": "2025-01-15",
"provider_name": "TestVPN"
}
},
"billing_address": {
Expand Down