Closed pmochine closed 2 years ago
My last commit with connection_timeout
is not working as intended. I'm still not sure how to resolve it, because SOAP has no direct way to change the timeout.
https://stackoverflow.com/questions/3500527/php-soapclient-timeout/12119215#12119215
Fixed the timeout bug with https://stackoverflow.com/a/68914117/7009480
@driesvints I know we are all busy but can I do something to make the pull faster :D
Thanks @pmochine. This is now released.
142
36
I have added the function
isValidVatNumberFormat
to validate the formating of the VAT number based on VIES.Besides that, I have added an option to the config file, to change the
connection_timeout
of the SOAP client. It's calledsoap_timeout
in the config file. Its default value is 30 seconds.Three questions came into my mind:
$vatNumber = str_replace([' ', "\xC2\xA0", "\xA0", '-', '.', ','], '', trim($vatNumber));
The question is. Why should I replace empty space? As it is officially okay to use it, according to VIES. Obviously, we should trim it. But why should we remove the rest? If the patterns do not match the VAT number string, we just say it's the wrong format.
soap_timeout
to 30 seconds. Is this a good default value?Thanks for letting me contribute :)