Skip to content
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

Merged
merged 6 commits into from
Sep 11, 2018
Merged

[Forwardport] Remove leading Countrycode from EU-VAT-Numbers #17921

merged 6 commits into from
Sep 11, 2018

Conversation

mage2pratik
Copy link
Contributor

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

  • [x ] Pull request has a meaningful description of its purpose
  • [x ] All commits are accompanied by meaningful commit messages
  • [x ] All new or changed code is covered with unit/integration tests (if applicable)
  • [x ] All automated tests passed successfully (all builds on Travis CI are green)

Drischie and others added 6 commits September 4, 2018 17:49
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.
@magento-engcom-team
Copy link
Contributor

Hi @mage2pratik. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me {$VERSION} instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

@miguelbalparda miguelbalparda self-assigned this Sep 4, 2018
@magento-engcom-team
Copy link
Contributor

Hi @sidolov, thank you for the review.
ENGCOM-2922 has been created to process this Pull Request

@magento-engcom-team
Copy link
Contributor

Hi @mage2pratik. Thank you for your contribution.
We will aim to release these changes as part of 2.3.0.
Please check the release notes for final confirmation.

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

Successfully merging this pull request may close these issues.

5 participants