PHP code example of oefenweb / cakephp-vat-number-check-webservice
1. Go to this page and download the library: Download oefenweb/cakephp-vat-number-check-webservice library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
oefenweb / cakephp-vat-number-check-webservice example snippets
CakePlugin::load('VatNumberCheck', ['routes' => true]);
public $vatNumberCheckWebservice = [
'datasource' => 'VatNumberCheck.SoapSource',
'wsdl' => 'https://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl',
'default_socket_timeout' => 2,
'connection_timeout' => 2,
];
$vatNumber = $this->VatNumberCheck->normalize($vatNumber);
$vatNumberValid = $this->VatNumberCheck->check($vatNumber);
echo $this->VatNumberCheck->input('vat_number', ['label' => __('VAT number')]);