@@ -594,11 +594,6 @@ class VatCalculator
594
594
*/
595
595
protected $ businessCountryCode = '' ;
596
596
597
- /**
598
- * @var string
599
- */
600
- protected $ ukValidationEndpoint = 'https://api.service.hmrc.gov.uk ' ;
601
-
602
597
/**
603
598
* @param \Illuminate\Contracts\Config\Repository|array
604
599
*/
@@ -901,22 +896,7 @@ public function getVATDetails($vatNumber)
901
896
$ vatNumber = substr ($ vatNumber , 2 );
902
897
903
898
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 https://github.com/driesvints/vat-calculator/pull/191. ' );
920
900
} else {
921
901
$ this ->initSoapClient ();
922
902
$ client = $ this ->soapClient ;
@@ -978,16 +958,4 @@ public function setSoapClient($soapClient)
978
958
{
979
959
$ this ->soapClient = $ soapClient ;
980
960
}
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
- }
993
961
}
0 commit comments