Skip to content

Commit

Permalink
add import flag to customer/prospect creation
Browse files Browse the repository at this point in the history
  • Loading branch information
TomK committed Dec 1, 2015
1 parent c30c7ce commit a573637
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/Models/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public function getVisitorId()
* @param string $subscriptionType
* @param bool $triggerLeadAction
* @param int $createdTime
* @param bool $isImport
*
* @return $this
*/
Expand All @@ -86,7 +87,7 @@ public function create(
$reference = null, $accountType = CustomerAccountType::RESIDENTIAL,
$accountStatus = CustomerAccountStatus::ACTIVE,
$subscriptionType = CustomerSubscriptionType::FREE,
$triggerLeadAction = false, $createdTime = null
$triggerLeadAction = false, $createdTime = null, $isImport = false
)
{
$exRef = ValueAs::nonempty($reference, $this->_externalReference);
Expand All @@ -104,6 +105,7 @@ public function create(
$createCustomerPayload->userIp = $this->_fortifi->getClientIp();
$createCustomerPayload->phoneNumber = $phoneNumber;
$createCustomerPayload->visitorId = $this->getVisitorId();
$createCustomerPayload->isImport = $isImport;

$customerEp = $this->_getEndpoint();
$req = $customerEp->createCustomer($createCustomerPayload);
Expand Down Expand Up @@ -355,7 +357,7 @@ public function retrieveCustomerByExternalReference($reference)
'externalReference',
AdvancedFilterComparator::EQUAL,
$reference
)
),
];
$customers = $this->_processRequest($ep->all($payload));
if(count($customers->items) >= 1)
Expand Down
6 changes: 4 additions & 2 deletions src/Models/Prospect.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,15 @@ public function getProspectFid()
* @param string $reference Your internal ID for this
* customer (e.g. user id)
* @param string $accountType
* @param string $createdTime
* @param int $createdTime
* @param bool $isImport
*
* @return $this
*/
public function create(
$companyFid, $email, $firstName, $lastName = null, $phoneNumber = null,
$reference = null, $accountType = CustomerAccountType::RESIDENTIAL,
$createdTime = null
$createdTime = null, $isImport = false
)
{
$exRef = ValueAs::nonempty($reference, $this->_externalReference);
Expand All @@ -58,6 +59,7 @@ public function create(
$createCustomerPayload->lastName = $lastName;
$createCustomerPayload->accountType = $accountType;
$createCustomerPayload->createdTime = $createdTime;
$createCustomerPayload->isImport = $isImport;

$customerEp = $this->_getEndpoint();
$req = $customerEp->createProspect($createCustomerPayload);
Expand Down

0 comments on commit a573637

Please sign in to comment.