-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Forwardport] Remove leading Countrycode from EU-VAT-Numbers #17921
[Forwardport] Remove leading Countrycode from EU-VAT-Numbers #17921
Conversation
EU-VAT-Numbers has always leading Countrycodes. To validate VAT-Number we have to remove it before sending the request. After we've checked if country is in eu we will remove the Countrycode and send the request.
Moved variable $requestParams[] out of ternary operator. To do this, the new variables $vatNumberSanitized and $requesterVatNumberSanitized are introduced.
Changed one-line ternary to multiline ternary to not exceed line-size-limit of 120 Characters.
Changed newly introduced variable VatNumberSanitized to reqVatNumSanitized to meet coding standards.
Hi @mage2pratik. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
Hi @sidolov, thank you for the review. |
Hi @mage2pratik. Thank you for your contribution. |
Original Pull Request
#17385
Description
EU-VAT-Numbers has always leading Countrycodes. To validate VAT-Number we have to remove it before sending the request.
After we've checked if country is in eu we will remove the Countrycode and send the request.
Fixed Issues (if relevant)
EU-VAT-Numbers always invalid cause of leading Countrycodes.
Manual testing scenarios
EU-VAT-Numbers looks like DEXXXXXXXXX for a german one.
Before change:
Giving DE 293 778 674 in Configuration->General->Store Information or in creating an Account will resullt in "Invalid VAT".
After change:
Giving DE 293 778 674 in Configuration->General->Store Information or in creating an Account will resullt in "VAT-Number is valid".
Contribution checklist