diff --git a/CHANGELOG.md b/CHANGELOG.md index 04d87d1..bf42f9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Fixed +- Accept two digit country codes + ## [1.22.0] - 2024-06-03 ### Fixed diff --git a/dotnet/Services/CybersourcePaymentService.cs b/dotnet/Services/CybersourcePaymentService.cs index 3a0194f..39c1f88 100644 --- a/dotnet/Services/CybersourcePaymentService.cs +++ b/dotnet/Services/CybersourcePaymentService.cs @@ -2259,7 +2259,14 @@ public string GetCountryCode(string country) string retval = string.Empty; if (!string.IsNullOrEmpty(country)) { - retval = CybersourceConstants.CountryCodesMapping[country]; + if (country.Length == 2) + { + retval = country; + } + else if (country.Length == 3) + { + retval = CybersourceConstants.CountryCodesMapping[country]; + } } return retval;