globalpayments / php-sdk

GNU General Public License v2.0
49 stars 66 forks source link

UK vs address.country and address.countryCode #114

Open joss45674 opened 1 year ago

joss45674 commented 1 year ago

The value of United Kingdom of Great Britain and Northern Ireland from IsoCountries appears to be too long and causes the error:

Unexpected Gateway Response: 506 - address.country : size must be between 0 and 50

Demo:

$customer = new \GlobalPayments\Api\Entities\Customer();
$customer->key = \GlobalPayments\Api\Utils\GenerationUtils::getGuid();
$customer->address = new \GlobalPayments\Api\Entities\Address();
$customer->address->countryCode = '826'; // This is UK 

try {
    $result = $customer->create();
} catch (\Exception $exception) {
    echo $exception->getMessage();
}