Skip to content

Commit

Permalink
Improved customer create
Browse files Browse the repository at this point in the history
  • Loading branch information
bajb committed Oct 27, 2015
1 parent a32809b commit dbcf33c
Showing 1 changed file with 2 additions and 24 deletions.
26 changes: 2 additions & 24 deletions src/Models/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ public function create(
$createCustomerPayload->accountStatus = $accountStatus;
$createCustomerPayload->subscriptionType = $subscriptionType;
$createCustomerPayload->createdTime = $createdTime;
$createCustomerPayload->userIp = $this->_fortifi->getClientIp();
$createCustomerPayload->phoneNumber = $phoneNumber;
$createCustomerPayload->visitorId = $this->getVisitorId();

$customerEp = $this->_getEndpoint();
Expand All @@ -105,17 +107,6 @@ public function create(

$this->_customerFid = $customer->fid;

if(!empty($phoneNumber))
{
try
{
$this->addPhoneNumber($phoneNumber, true);
}
catch(\Exception $e)
{
}
}

if($triggerLeadAction)
{
$trigger = $this->_fortifi->visitor($this->_visitorId)->triggerAction(
Expand Down Expand Up @@ -158,19 +149,6 @@ public function create(
}
}

try
{
$locationPayload = new CustomerSetLocationPayload();
$locationPayload->fid = $this->_customerFid;
$locationPayload->userIp = $this->_fortifi->getClientIp();
$this->_processRequest(
$this->_getEndpoint()->setLocation($locationPayload)
);
}
catch(\Exception $e)
{
}

return $this;
}

Expand Down

0 comments on commit dbcf33c

Please sign in to comment.