tijsverkoyen / bpost

Other
28 stars 47 forks source link

Postalcode is limited to 8 characters instead of suggested 40 in your class #30

Open stijnster opened 6 years ago

stijnster commented 6 years ago

Hi Tijs,

Could you please check and verify that the maximum amount of characters for postalcodes is 8, instead of the 40 that you check on in your class;

tijsverkoyen/bpost/Bpost/Order/Address.php

public function setPostalCode($postalCode) { $length = 40; if (mb_strlen($postalCode) > $length) { throw new Exception(sprintf('Invalid length, maximum is %1$s.', $length)); } $this->postalCode = $postalCode; }

We received this error when we passed in a value, longer then 8.

TijsVerkoyen\Bpost\Exception: Uncaught exception 'TijsVerkoyen\Bpost\Exception' with message 'Error in request: cvc-maxLength-valid: Value '123456789012' with length = '12' is not facet-valid with respect to maxLength '8' for type 'PostalCodeType'.

Thanks for your work on this!