Skip to content

Commit c7e74b6

Browse files
committed
Upgrade geoip2 to add MCC/MNC
1 parent 5f58e0b commit c7e74b6

5 files changed

Lines changed: 17 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ CHANGELOG
44
1.19.0
55
-------------------
66

7+
* Upgraded the `geoip2` dependency to 2.16.1. This adds mobile country code
8+
(MCC) and mobile network code (MNC) to minFraud Insights and Factors
9+
responses. These are available at
10+
`response.getIpAddress.getTraits.getMobileCountryCode()` and
11+
`response.getIpAddress.getTraits.getMobileNetworkCode()`. We expect this
12+
data to be available by late January 2022.
713
* The following payment processors were added to the `Payment.Processor` enum:
814
* `BOACOMPRA`
915
* `BOKU`

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
<dependency>
6363
<groupId>com.maxmind.geoip2</groupId>
6464
<artifactId>geoip2</artifactId>
65-
<version>2.15.0</version>
65+
<version>2.16.1</version>
6666
</dependency>
6767
<dependency>
6868
<groupId>org.apache.httpcomponents</groupId>

src/test/java/com/maxmind/minfraud/response/IpAddressTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ public void testIpAddress() throws Exception {
3636
.put("is_hosting_provider", true)
3737
.put("is_public_proxy", true)
3838
.put("is_tor_exit_node", true)
39+
.put("mobile_country_code", "310")
40+
.put("mobile_network_code", "004")
3941
.put("network", "1.2.0.0/16")
4042
.end()
4143
.end()
@@ -51,6 +53,10 @@ public void testIpAddress() throws Exception {
5153
assertTrue("isHostingProvider", address.getTraits().isHostingProvider());
5254
assertTrue("isPublicProxy", address.getTraits().isPublicProxy());
5355
assertTrue("isTorExitNode", address.getTraits().isTorExitNode());
56+
assertEquals("mobile country code", "310",
57+
address.getTraits().getMobileCountryCode());
58+
assertEquals("mobile network code", "004",
59+
address.getTraits().getMobileNetworkCode());
5460
assertEquals("IP risk reason code", "ANONYMOUS_IP",
5561
address.getRiskReasons().get(0).getCode());
5662
assertEquals("IP risk reason", "some reason",

src/test/resources/test-data/factors-response.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@
104104
"is_satellite_provider": true,
105105
"is_tor_exit_node": true,
106106
"isp": "Andrews & Arnold Ltd",
107+
"mobile_country_code": "310",
108+
"mobile_network_code": "004",
107109
"network": "81.2.69.0/24",
108110
"organization": "STONEHOUSE office network",
109111
"user_type": "government"

src/test/resources/test-data/insights-response.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@
118118
"is_satellite_provider": true,
119119
"is_tor_exit_node": true,
120120
"isp": "Andrews & Arnold Ltd",
121+
"mobile_country_code": "310",
122+
"mobile_network_code": "004",
121123
"network": "81.2.69.0/24",
122124
"organization": "STONEHOUSE office network",
123125
"user_type": "government"

0 commit comments

Comments
 (0)