@@ -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 https://github.com/driesvints/vat-calculator/pull/191. ' );
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