Skip to content

Commit 5fff70f

Browse files
committed
Remove UK VAT checks
1 parent 6671959 commit 5fff70f

File tree

1 file changed

+1
-33
lines changed

1 file changed

+1
-33
lines changed

src/VatCalculator.php

+1-33
Original file line numberDiff line numberDiff line change
@@ -594,11 +594,6 @@ class VatCalculator
594594
*/
595595
protected $businessCountryCode = '';
596596

597-
/**
598-
* @var string
599-
*/
600-
protected $ukValidationEndpoint = 'https://api.service.hmrc.gov.uk';
601-
602597
/**
603598
* @param \Illuminate\Contracts\Config\Repository|array
604599
*/
@@ -901,22 +896,7 @@ public function getVATDetails($vatNumber)
901896
$vatNumber = substr($vatNumber, 2);
902897

903898
if (strtoupper($countryCode) === 'GB') {
904-
$apiHeaders = get_headers("$this->ukValidationEndpoint/organisations/vat/check-vat-number/lookup/$vatNumber");
905-
$apiHeaders = explode(' ', $apiHeaders[0]);
906-
$apiStatusCode = (int) $apiHeaders[1];
907-
908-
if ($apiStatusCode === 400 || $apiStatusCode === 404) {
909-
return false;
910-
}
911-
912-
if ($apiStatusCode === 200) {
913-
$apiResponse = file_get_contents("$this->ukValidationEndpoint/organisations/vat/check-vat-number/lookup/$vatNumber");
914-
$apiResponse = json_decode($apiResponse, true);
915-
916-
return $apiResponse['target'];
917-
}
918-
919-
throw new VATCheckUnavailableException("The UK VAT check service is currently unavailable (status code $apiStatusCode). Please try again later.");
899+
throw new VATCheckUnavailableException("UK VAT checks are no longer available. Please see .");
920900
} else {
921901
$this->initSoapClient();
922902
$client = $this->soapClient;
@@ -978,16 +958,4 @@ public function setSoapClient($soapClient)
978958
{
979959
$this->soapClient = $soapClient;
980960
}
981-
982-
/**
983-
* @return $this
984-
*
985-
* @internal This method is not covered by our BC policy.
986-
*/
987-
public function testing()
988-
{
989-
$this->ukValidationEndpoint = 'https://test-api.service.hmrc.gov.uk';
990-
991-
return $this;
992-
}
993961
}

0 commit comments

Comments
 (0)