-
Notifications
You must be signed in to change notification settings - Fork 30
Seller specific vat check with verification identifier in response #79
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
base: master
Are you sure you want to change the base?
Seller specific vat check with verification identifier in response #79
Conversation
|
@nickbruun @kdeldycke @aladagemre @sniku may you kindly have a look at this PR? |
|
Looks good to me. @martinleblanc Can you have a look? :) |
|
Thanks for the re-direct @JanmanX and for your email! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for retrieving VIES consultation numbers (requestIdentifier) when validating EU VAT numbers, enabling businesses to maintain audit trails required by tax authorities.
Key Changes:
- Introduces
check_vat_number_with_request_identifier()function that uses VIEScheckVatApproxSOAP endpoint - Adds
request_identifierfield toVatNumberCheckResultfor storing consultation numbers - Implements prefix-agnostic XML parsing to handle varying namespace prefixes in VIES responses
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| pyvat/init.py | Adds new public API function for VAT validation with request identifier support |
| pyvat/result.py | Extends result class with request_identifier field and updates documentation |
| pyvat/registries.py | Implements checkVatApprox SOAP call with robust XML parsing and identifier extraction |
| pyvat/utils.py | Adds utility function for prefix-agnostic XML element lookup |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
Logging sensitive data (privacy/GDPR) Recommendation: |
|
@TNGkernelMaster please check the comments above |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Hey @martinleblanc I believe all the comments have been addressed. Kindly let me know if you spot anything missing. |
|
hey @martinleblanc, a kind reminder. |
|
Hey @martinleblanc - it would be great if we could close this as we will really want to use your library! |
✨ feat(vies): expose VIES
requestIdentifier(consultation number)✅ What changed
New field:
request_identifierinVatNumberCheckResultNew path:
checkVatApproxflow that returnsrequestIdentifierwhen requester details are providedPrefix-agnostic parsing: robust XML by localName (ignores
nsX:prefixes)Field mapping:
traderName→business_name,traderAddress→business_addressHTTPS endpoint: ensured SOAP URL uses HTTPS
Logging:
log_linesinclude request/response and the parsedrequestIdentifier🔒 Backward compatibility
🧭 Usage
🧪 Tests
Canned
checkVatApproxResponseXML verifies:is_valid == Truebusiness_country_code == "PL"business_name/business_addressparsedrequest_identifier == "WAPIAAAAZnnAjXKl"DEVELOPER COMMENTS
Check if a VAT number is valid using a registry that supports request identification.
This function validates the given VAT number, taking into account the requester's information (requester_country_code and requester_vat_number) as required by certain national authorities for proper auditing and evidence. When called, the function will attempt to verify the VAT number and will return a VatNumberCheckResult instance containing the result of the validation. The result object also contains a 'verificationIdentifier' (request_identifier), which serves as a unique proof of the verification that can be stored and presented to authorities should a selling company undergo an audit.