option to store vies VAT consultation number
-
Hi,
In some EU countries it is required to have “consultation number” from vies response (requestIdentifier) stored as a proof that vat number vas valid.
Is it possible to add this option, since now we have to edit plugin code every time it’s updated to have this option.
In order to get this number, it’s required to send requester vat number in vies request. There should be a new option added for this field.
Old “Eu vat assistant” plugin had this option, and stored the resulting string as “vies_consultation_number” in db, so we reused that name for compatibility reasons.
This is how we do it now for soap request:
In alg-wc-eu-vat-functions-validation.php we changed checkVat with checkVatApprox:
$result = $client->checkVatApprox( array(
’countryCode’ => $country_code,
? ‘vatNumber’ ? => $vat_number,>
’requesterCountryCode’ ?=> ‘COUNTRYCODE’,
’requesterVatNumber’ ? ?=> ‘VATNUMBER’
) );And we hacked storing the result in the return function with:
update_post_meta( $order_id, ‘vies_consultation_number’, $result->requestIdentifier );
- You must be logged in to reply to this topic.