invoice = $invoice; $this->db = $db; } /** * Execute the job. * * @return void */ public function handle() : void { set_time_limit(0); if($this->db) MultiDB::setDb($this->db); try{ nlog("autobill {$this->invoice->id}"); $this->invoice->service()->autoBill()->save(); } catch(\Exception $e) { nlog("Failed to capture payment for {$this->invoice->company_id} - {$this->invoice->number} ->" . $e->getMessage()); } } }