Skip to content

Commit 1c554af

Browse files
authored
Merge pull request #178 from saumil122/master
Created function to generate account_activation_link
2 parents d83f6d7 + 24ff4e4 commit 1c554af

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
@@ -546,6 +546,11 @@ public function processResponse($responseArray, $dataKey = null)
546546
if (isset($responseArray['errors'])) {
547547
$message = $this->castString($responseArray['errors']);
548548

549+
//check account already enabled or not
550+
if($message=='account already enabled'){
551+
return array('account_activation_url'=>false);
552+
}
553+
549554
throw new ApiException($message, CurlRequest::$lastHttpCode);
550555
}
551556

0 commit comments

Comments
 (0)