Skip to content

Conversation

@pmochine
Copy link
Contributor

@pmochine pmochine commented Jun 10, 2022

#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_timeoutof the SOAP client. It's called soap_timeout in the config file. Its default value is 30 seconds.

Three questions came into my mind:

  1. When validating the formate, I have used your code to "clean up" the VAT number:

$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.

  1. I have set the soap_timeout to 30 seconds. Is this a good default value?
  2. I have used some code from another package. How do you give credits in the comments block? (Not sure how it's done usually)

Thanks for letting me contribute :)

@pmochine
Copy link
Contributor Author

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

@pmochine
Copy link
Contributor Author

Fixed the timeout bug with https://stackoverflow.com/a/68914117/7009480

@pmochine
Copy link
Contributor Author

pmochine commented Jul 3, 2022

@driesvints I know we are all busy but can I do something to make the pull faster :D

@driesvints driesvints merged commit 640edd2 into laravel:3.x Jul 6, 2022
@driesvints
Copy link
Member

Thanks @pmochine. This is now released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants