From 775162af9da5df3f4b73ddb86ed572e581ac7593 Mon Sep 17 00:00:00 2001 From: Sebastian Marcet Date: Thu, 13 Apr 2017 13:23:52 -0300 Subject: [PATCH] Changes on mandatory fields from eventbrite api request, on profile json object company and job_title are not longer mandatories Change-Id: Ia3f2e2d5918b575a21e5124b89ab24f23a3a7370 --- app/Services/Model/SummitService.php | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/app/Services/Model/SummitService.php b/app/Services/Model/SummitService.php index cfdf91f9..7e7e6b41 100644 --- a/app/Services/Model/SummitService.php +++ b/app/Services/Model/SummitService.php @@ -818,21 +818,20 @@ final class SummitService implements ISummitService if (!is_null($old_ticket)) continue; - array_push($attendees, array( + $attendees[] = [ 'external_id' => intval($a['id']), - 'first_name' => $a['profile']['first_name'], - 'last_name' => $a['profile']['last_name'], - 'company' => $a['profile']['company'], - 'email' => $a['profile']['email'], - 'job_title' => $a['profile']['job_title'], - 'status' => $a['status'], - 'ticket_type' => array - ( - 'id' => intval($ticket_type->getId()), - 'name' => $ticket_type->getName(), + 'first_name' => $a['profile']['first_name'], + 'last_name' => $a['profile']['last_name'], + 'email' => $a['profile']['email'], + 'company' => isset($a['profile']['company']) ? $a['profile']['company'] : null, + 'job_title' => isset($a['profile']['job_title']) ? $a['profile']['job_title'] : null, + 'status' => $a['status'], + 'ticket_type' => [ + 'id' => intval($ticket_type->getId()), + 'name' => $ticket_type->getName(), 'external_id' => $ticket_external_id, - ) - )); + ] + ]; } if (count($attendees) === 0) throw new ValidationException(sprintf('order %s already redeem!', $external_order_id));