/** * @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); } }