sprain/php-swiss-qr-bill

license plate of Liechtenstein as country code...

auerswald opened this issue · 3 comments

if (in_array($this->getCountry(), ['CH', 'FL'])) {

FL is the license plate of Liechtenstein, but not the country code... 🤓

if (in_array($this->getCountry(), ['CH', 'LI'])) {
    // ...
}

same error in:

if (in_array($this->getCountry(), ['CH', 'FL'])) {

Please reopen.

The country code of Liechtenstein is indeed 'LI', but the code actually only produced the correct result before the fix (by accident, because 'FL' is no valid country).

https://www.paymentstandards.ch/dam/downloads/ig-qr-bill-en.pdf says: "For invoicing to countries outside Switzerland, including Lichtenstein[sic!], the country code should be printed on the payment section."

I.e. the correct fix would have been to replace the whole
in_array($this->getCountry(), ['CH', 'FL'])
with
`$this->getCountry() === 'CH'

The CombinedAddressTest and StructuredAddressTest should also be fixed to expect \nLI-9490 Vaduz.