checkvat_number(); } private function checkvat_number(): array { $wsdl = "https://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl"; try { $client = new \SoapClient($wsdl); $params = [ 'countryCode' => $this->country_code, 'vatNumber' => $this->vat_number ]; $response = $client->checkVat($params); if ($response->valid) { return [ 'valid' => true, 'name' => $response->name, 'address' => $response->address ]; } else { return ['valid' => false]; } } catch (\SoapFault $e) { // Handle error, e.g., log or display an error message return ['error' => $e->getMessage()]; } } }