client->shipping_country ? $this->client->shipping_country->iso_3166_2 : $this->client->country->iso_3166_2; $vat_check = (new VatNumberCheck($this->client->vat_number, $client_country_code))->run(); nlog($vat_check); if($vat_check->isValid()) { $this->client->has_valid_vat_number = true; if(!$this->client->name && strlen($vat_check->getName()) > 2) { $this->client->name = $vat_check->getName(); } if(empty($this->client->private_notes) && strlen($vat_check->getAddress()) > 2) { $this->client->private_notes = $vat_check->getAddress(); } $this->client->saveQuietly(); } return $this; } public function initTaxProvider() { } }