/** * @author EB * @param Request $request * @param $location * @return array|\Illuminate\Http\Response */ public function setProfileFinancial(Request $request, $location) { /** @var Location $location */ $location = Location::findOrFail($location)->first(); try { return $this->profileGateway->setFinancial($request->get('user'), ['monthly_income' => (int) $request->get('monthly_income'), 'monthly_outgoings' => (int) $request->get('monthly_outgoings'), 'bank_sort_code' => (string) $request->get('bank_sort_code'), 'bank_account' => (string) $request->get('bank_account')], $location->installation->merchant->token); } catch (\Exception $e) { $this->logError('Set Profile Financial failed: ' . $e->getMessage(), $request->all()); return $this->apiResponseFromException($e, 422); } }
/** * @author EB * @param Request $request * @param Location $location * @param Application $application * @return Application * @throws \Exception */ private function createProfilePersonal(Request $request, Location $location, Application $application) { $this->profileGateway->createPersonal($application->ext_id, ['first_name' => (string) $request->get('first_name'), 'last_name' => (string) $request->get('last_name'), 'phone_mobile' => (string) $request->get('phone_mobile'), 'phone_home' => (string) $request->get('phone_home')], $location->installation->merchant->token); return $this->applicationSynchronisationService->synchroniseApplication($application->id); }