Skip to content

Commit

Permalink
Get customer types
Browse files Browse the repository at this point in the history
  • Loading branch information
ursuleacv committed Feb 7, 2019
1 parent d7735a4 commit 3f08f8f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "ursuleacv/oauth2-lightspeed",
"description": "LightSpeed OAuth 2.0 Client Provider for The PHP League OAuth2-Client",
"license": "MIT",
"version": "2.0.25",
"version": "2.0.26",
"authors": [
{
"name": "Valentin Ursuleac",
Expand Down
17 changes: 17 additions & 0 deletions src/Provider/MerchantOS.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,23 @@ public function getTags($params = [])
return [];
}

/**
* @param $params
* @return array
*/
public function getCustomerTypes($params = [])
{
$response = $this->makeAPICall('Account.CustomerType', 'GET', null, $params, null);

if (isset($response['CustomerType']) && $this->itemsCount($response) == 1) {
return [$response['CustomerType']];
} elseif (isset($response['CustomerType']) && $this->itemsCount($response) > 1) {
return $response['CustomerType'];
}

return [];
}

/**
* @param $params
* @return array
Expand Down

0 comments on commit 3f08f8f

Please sign in to comment.