db = $db; $this->company_gateway = $company_gateway; } /** * Execute the job. * * @return void */ public function handle() { MultiDB::setDB($this->db); if(in_array($this->company_gateway->gateway_key, $this->stripe_keys)) { $domain = $this->getDomain(); try{ $this->company_gateway->driver()->setApplePayDomain($domain); } catch(\Exception $e){ nlog("failed to set Apple Domain with Stripe " . $e->getMessage()); } } } private function getDomain() { $domain = ''; if(Ninja::isHosted()) { if($this->company->portal_mode == 'domain'){ $domain = $this->company->portal_domain; } else{ $domain = $this->company->subdomain . '.' . config('ninja.app_domain'); } } else { $domain = config('ninja.app_url'); } $parsed_url = parse_url($domain); return $parsed_url['host']; } }