setTestMode(); $company = $request->getCompany(); if($company->account->bank_integration_account_id){ $flow = 'edit'; $token = $company->account->bank_integration_account_id; } else{ $flow = 'add'; $response = $yodlee->createUser($company); $token = $response->user->loginName; $company->account->bank_integration_account_id = $token; $company->push(); } $yodlee = new Yodlee($token); $yodlee->setTestMode(); $data = [ 'access_token' => $yodlee->getAccessToken(), 'fasttrack_url' => $yodlee->getFastTrackUrl(), 'config_name' => 'testninja', 'flow' => $flow, 'company' => $company, 'account' => $company->account, ]; return view('bank.yodlee.auth', $data); } }