Beispiel #1
0
 /**
  * @author EA
  * @param Request $request
  * @param int $location
  * @return array|\Illuminate\Http\Response
  */
 public function addProfileAddress(Request $request, $location)
 {
     /** @var Location $location */
     $location = Location::findOrFail($location)->first();
     try {
         return $this->profileGateway->setAddress((int) $request->get('user'), ['abode' => (string) $request->get('abode'), 'building_name' => (string) $request->get('building_name'), 'building_number' => (string) $request->get('building_number'), 'street' => (string) $request->get('street'), 'locality' => (string) $request->get('locality'), 'town' => (string) $request->get('town'), 'postcode' => (string) $request->get('postcode'), 'moved_in' => (string) $request->get('moved_in'), 'residential_status' => (int) $request->get('residential_status')], $location->installation->merchant->token);
     } catch (\Exception $e) {
         $this->logError('Add address Failed: ' . $e->getMessage(), $request->all());
         return $this->apiResponseFromException($e, 422);
     }
 }