uawdijnntqw1x1x1
IP : 216.73.216.8
Hostname : toronto-dev2
Kernel : Linux toronto-dev2 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64
Disable Function : None :)
OS : Linux
PATH:
/
srv
/
users
/
craft4
/
apps
/
craft4-newsite-space
/
public
/
..
/
vendor
/
ibericode
/
vat
/
src
/
Vies
/
Client.php
/
/
<?php declare(strict_types=1); namespace DvK\Vat\Vies; use SoapClient; use SoapFault; class Client { /** * @const string */ const URL = 'http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl'; /** * @var SoapClient */ private $client; /** * @var int */ protected $timeout; /** * Client constructor. * * @param int $timeout How long should we wait before aborting the request to VIES? */ public function __construct(int $timeout = 10) { $this->timeout = $timeout; } /** * @param string $countryCode * @param string $vatNumber * * @return bool * * @throws ViesException */ public function checkVat(string $countryCode, string $vatNumber) : bool { try { $response = $this->getClient()->checkVat( array( 'countryCode' => $countryCode, 'vatNumber' => $vatNumber ) ); } catch( SoapFault $e ) { throw new ViesException( $e->getMessage(), $e->getCode() ); } return (bool) $response->valid; } /** * @return SoapClient */ protected function getClient() : SoapClient { if ($this->client === null) { $this->client = new SoapClient(self::URL, ['connection_timeout' => $this->timeout]); } return $this->client; } }
/srv/users/craft4/apps/craft4-newsite-space/public/../vendor/ibericode/vat/src/Vies/Client.php