Added isValidVatNumberFormat + connection_timeout for the SOAP Client #143
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#142
#36
I have added the function
isValidVatNumberFormatto 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_timeoutof the SOAP client. It's calledsoap_timeoutin 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_timeoutto 30 seconds. Is this a good default value?Thanks for letting me contribute :)