Skip to content

Commit d0e7fe7

Browse files
committed
Created function to generate account_activation_link
for a specific customer
1 parent a233b8d commit d0e7fe7

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

lib/Customer.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,21 @@ public function send_invite($customer_invite = array())
6060

6161
return $this->post($dataArray, $url, false);
6262
}
63+
64+
/**
65+
* Create account_activation_link for customer.
66+
*
67+
* @param array $customer_id
68+
*
69+
* @return array
70+
*/
71+
public function account_activation_url($customer_id = 0)
72+
{
73+
if (!(int)$customer_id > 0) {
74+
return false;
75+
}
76+
77+
$url = $this->generateUrl(array(), $customer_id.'/account_activation_url');
78+
return $this->post(array(), $url, false);
79+
}
6380
}

lib/ShopifyResource.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,11 @@ public function processResponse($responseArray, $dataKey = null)
540540
if (isset($responseArray['errors'])) {
541541
$message = $this->castString($responseArray['errors']);
542542

543+
//check account already enabled or not
544+
if($message=='account already enabled'){
545+
return array('account_activation_url'=>false);
546+
}
547+
543548
throw new ApiException($message, CurlRequest::$lastHttpCode);
544549
}
545550

0 commit comments

Comments
 (0)