Skip to content

Commit

Permalink
Merge pull request #40 from maxmind/greg/is-in-eu
Browse files Browse the repository at this point in the history
Add IsInEuropeanUnion
  • Loading branch information
horgh authored Jan 20, 2018
2 parents a8943f4 + b3bfd8c commit a36b7d0
Show file tree
Hide file tree
Showing 12 changed files with 73 additions and 38 deletions.
8 changes: 4 additions & 4 deletions MaxMind.MinFraud.UnitTest/MaxMind.MinFraud.UnitTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
<PackageReference Include="MockHttpSigned" Version="1.3.0-netstandard-alpha3" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Include="xunit" Version="2.3.0" />
<PackageReference Include="xunit.core" Version="2.3.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0" />
<PackageReference Include="xunit" Version="2.3.1" />
<PackageReference Include="xunit.core" Version="2.3.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net452' ">
Expand Down
2 changes: 1 addition & 1 deletion MaxMind.MinFraud.UnitTest/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MaxMind.MinFraud.UnitTest")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyCopyright("Copyright © 2015-2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand Down
7 changes: 6 additions & 1 deletion MaxMind.MinFraud.UnitTest/Response/GeoIP2CountryTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ public class GeoIP2CountryTest
[Fact]
public void TestIsHighRisk()
{
var country = new JObject {{"is_high_risk", true}}.ToObject<GeoIP2Country>();
var country = new JObject
{
{"is_high_risk", true},
{"is_in_european_union", true }
}.ToObject<GeoIP2Country>();
Assert.True(country.IsInEuropeanUnion);
Assert.True(country.IsHighRisk);
}
}
Expand Down
29 changes: 15 additions & 14 deletions MaxMind.MinFraud.UnitTest/TestData/factors-response.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"id": "27d26476-e2bc-11e4-92b8-962e705b4af5",
"risk_score": 0.01,
"funds_remaining": 10.01,
Expand All @@ -17,9 +17,9 @@
"en": "London",
"es": "Londres",
"fr": "Londres",
"ja": "\u30ed\u30f3\u30c9\u30f3",
"ja": "ロンドン",
"pt-BR": "Londres",
"ru": "\u041b\u043e\u043d\u0434\u043e\u043d"
"ru": "Лондон"
}
},
"continent": {
Expand All @@ -30,26 +30,27 @@
"en": "Europe",
"es": "Europa",
"fr": "Europe",
"ja": "\u30e8\u30fc\u30ed\u30c3\u30d1",
"ja": "ヨーロッパ",
"pt-BR": "Europa",
"ru": "\u0415\u0432\u0440\u043e\u043f\u0430",
"zh-CN": "\u6b27\u6d32"
"ru": "Европа",
"zh-CN": "欧洲"
}
},
"country": {
"confidence": 99,
"geoname_id": 2635167,
"is_high_risk": false,
"is_in_european_union": true,
"iso_code": "GB",
"names": {
"de": "Vereinigtes K\u00f6nigreich",
"de": "Vereinigtes Königreich",
"en": "United Kingdom",
"es": "Reino Unido",
"fr": "Royaume-Uni",
"ja": "\u30a4\u30ae\u30ea\u30b9",
"ja": "イギリス",
"pt-BR": "Reino Unido",
"ru": "\u0412\u0435\u043b\u0438\u043a\u043e\u0431\u0440\u0438\u0442\u0430\u043d\u0438\u044f",
"zh-CN": "\u82f1\u56fd"
"ru": "Великобритания",
"zh-CN": "英国"
}
},
"location": {
Expand All @@ -66,11 +67,11 @@
"de": "USA",
"en": "United States",
"es": "Estados Unidos",
"fr": "\u00c9tats-Unis",
"ja": "\u30a2\u30e1\u30ea\u30ab\u5408\u8846\u56fd",
"fr": "États-Unis",
"ja": "アメリカ合衆国",
"pt-BR": "Estados Unidos",
"ru": "\u0421\u0428\u0410",
"zh-CN": "\u7f8e\u56fd"
"ru": "США",
"zh-CN": "美国"
}
},
"subdivisions": [
Expand Down
29 changes: 15 additions & 14 deletions MaxMind.MinFraud.UnitTest/TestData/insights-response.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"id": "27d26476-e2bc-11e4-92b8-962e705b4af5",
"risk_score": 0.01,
"funds_remaining": 10.01,
Expand All @@ -17,9 +17,9 @@
"en": "London",
"es": "Londres",
"fr": "Londres",
"ja": "\u30ed\u30f3\u30c9\u30f3",
"ja": "ロンドン",
"pt-BR": "Londres",
"ru": "\u041b\u043e\u043d\u0434\u043e\u043d"
"ru": "Лондон"
}
},
"continent": {
Expand All @@ -30,26 +30,27 @@
"en": "Europe",
"es": "Europa",
"fr": "Europe",
"ja": "\u30e8\u30fc\u30ed\u30c3\u30d1",
"ja": "ヨーロッパ",
"pt-BR": "Europa",
"ru": "\u0415\u0432\u0440\u043e\u043f\u0430",
"zh-CN": "\u6b27\u6d32"
"ru": "Европа",
"zh-CN": "欧洲"
}
},
"country": {
"confidence": 99,
"geoname_id": 2635167,
"is_high_risk": false,
"is_in_european_union": true,
"iso_code": "GB",
"names": {
"de": "Vereinigtes K\u00f6nigreich",
"de": "Vereinigtes Königreich",
"en": "United Kingdom",
"es": "Reino Unido",
"fr": "Royaume-Uni",
"ja": "\u30a4\u30ae\u30ea\u30b9",
"ja": "イギリス",
"pt-BR": "Reino Unido",
"ru": "\u0412\u0435\u043b\u0438\u043a\u043e\u0431\u0440\u0438\u0442\u0430\u043d\u0438\u044f",
"zh-CN": "\u82f1\u56fd"
"ru": "Великобритания",
"zh-CN": "英国"
}
},
"location": {
Expand All @@ -66,11 +67,11 @@
"de": "USA",
"en": "United States",
"es": "Estados Unidos",
"fr": "\u00c9tats-Unis",
"ja": "\u30a2\u30e1\u30ea\u30ab\u5408\u8846\u56fd",
"fr": "États-Unis",
"ja": "アメリカ合衆国",
"pt-BR": "Estados Unidos",
"ru": "\u0421\u0428\u0410",
"zh-CN": "\u7f8e\u56fd"
"ru": "США",
"zh-CN": "美国"
}
},
"subdivisions": [
Expand Down
4 changes: 4 additions & 0 deletions MaxMind.MinFraud.UnitTest/WebServiceClientTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ public async Task TestFullInsightsRequest()
// The purpose here is to test that SetLocales worked as expected
Assert.Equal("London", response.IPAddress.City.Name);
Assert.Equal("United Kingdom", response.IPAddress.Country.Name);

Assert.True(response.IPAddress.Country.IsInEuropeanUnion);
Assert.False(response.IPAddress.RegisteredCountry.IsInEuropeanUnion);
Assert.False(response.IPAddress.RepresentedCountry.IsInEuropeanUnion);
}

[Fact]
Expand Down
4 changes: 3 additions & 1 deletion MaxMind.MinFraud/MaxMind.MinFraud.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MaxMind.GeoIP2" Version="2.9.0" />
<PackageReference Include="MaxMind.GeoIP2" Version="2.10.0" />
<PackageReference Include="Microsoft.CSharp" Version="4.4.1" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Include="System.ComponentModel.Annotations" Version="4.4.1" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
Expand Down
2 changes: 1 addition & 1 deletion MaxMind.MinFraud/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("MaxMind, Inc.")]
[assembly: AssemblyProduct("MaxMind.MinFraud")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyCopyright("Copyright © 2015-2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand Down
12 changes: 12 additions & 0 deletions README.dev.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
To publish the to NuGet:

1. Review open issues and PRs to see if any can easily be fixed, closed, or
merged.
2. Bump copyright year in `README.md` and the `AssemblyInfo.cs` files, if
necessary.
3. Review `releasenotes.md` for completeness and correctness. Update its release
date.
4. Run dev-bin/release.sh. This will build the project, generate docs, upload to
NuGet, and make a GitHub release.
5. Update GitHub Release page for the release.
6. Verify the release on [NuGet](https://www.nuget.org/packages/MaxMind.MaxMind/).
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,6 @@ This API uses [Semantic Versioning](http://semver.org/).

## Copyright and License ##

This software is Copyright (c) 2015-2017 by MaxMind, Inc.
This software is Copyright (c) 2015-2018 by MaxMind, Inc.

This is free software, licensed under the Apache License, Version 2.0.
7 changes: 6 additions & 1 deletion dev-bin/release.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,12 @@ if ((Read-Host -Prompt 'Should push? (y/n)') -ne 'y') {
& git push

Pop-Location
& hub release create "$tag"
& git push

if ((Read-Host -Prompt 'Should release? (y/n)') -ne 'y') {
Write-Error 'Aborting'
}

& hub release create "$tag"

& nuget push "MaxMind.MinFraud/bin/Release/MaxMind.MinFraud.$version.nupkg" -Source https://www.nuget.org/api/v2/package
5 changes: 5 additions & 0 deletions releasenotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ Release Notes
1.6.0
------------------

* Updated `MaxMind.GeoIP2` dependency. With this version, the
`IsInEuropeanUnion` property is now available on
`MaxMind.MinFraud.Response.GeoIP2Country` and
`MaxMind.GeoIP2.Model.RepresentedCountry`. `IsInEuropeanUnion` is `true` if
the country is a member state of the European Union.
* Added the following new values to the `PaymentProcessor` enum:
* `Cybersource`
* `TransactPro`
Expand Down

0 comments on commit a36b7d0

Please sign in to comment.