VIES VAT号码验证 [英] VIES VAT number validation

查看:427
本文介绍了VIES VAT号码验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都知道如何在我们的网站上添加表单以验证VIES?我找到了通过欧盟网站验证的信息。

http://ec.europa.eu/taxation_customs/vies/vieshome.do



我感兴趣的是直接从支付数据来自我的网站。



谢谢。

发送一个普通的HTML表单到服务器。

最简单的解决方案是在URL中传递参数并使用 file_get_contents 来获得响应。



然后可以解析响应以提取所需的信息。未经测试,但显示了这个想法:

  $ country1 ='PL'; 
$ country2 ='PL';
$ vatnum1 ='123456';
$ vatnum2 ='789012';

//准备网址
$ url ='http://ec.europa.eu/taxation_customs/vies/viesquer.do?ms='.$country1.'&iso = '$ COUNTRY1。 '和;增值税=放' $ vatnum1。 ';名称=安培; companyType =安培; street1 =安培;邮编=安培;城市=安培; requesterMs =' $ COUNTRY2。' 和; requesterIso = $ COUNTRY2。 '&安培; requesterVat =安培' $ vatnum2。 '; BtnSubmitVat =验证';

$ response = file_get_contents($ url);
//做出回应
echo $ response;


anyone knows a way to incorporate a form on our website to validate the VIES? I find information to validate it through the website of the European Union.

http://ec.europa.eu/taxation_customs/vies/vieshome.do

And what interest me is validate directly from the form of payment data from my website.

Thanks.

解决方案

This websites sends an ordinary HTML form to a server.

The simplest solution is to pass the params in the URL and use file_get_contents to get the response.

The response can then be parsed to extract the information you want. Not tested, but shows the idea:

$country1 = 'PL';
$country2 = 'PL';
$vatnum1 = '123456';
$vatnum2 = '789012';

//Prepare the URL
$url = 'http://ec.europa.eu/taxation_customs/vies/viesquer.do?ms='.$country1.'&iso='.$country1.'&vat='.$vatnum1.'&name=&companyType=&street1=&postcode=&city=&requesterMs='.$country2.'&requesterIso='.$country2.'&requesterVat='.$vatnum2.'&BtnSubmitVat=Verify';

$response = file_get_contents($url);
// Do sth with the response
echo $response;

这篇关于VIES VAT号码验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆