Skip to content

Commit

Permalink
get categories
Browse files Browse the repository at this point in the history
  • Loading branch information
ursuleacv committed Dec 21, 2016
1 parent a0e9e42 commit 02d622e
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.10",
"version": "2.0.11",
"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 @@ -64,6 +64,23 @@ public function getTags($params = [])

return [];
}

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

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

return [];
}

/**
* @param $itemId
Expand Down

0 comments on commit 02d622e

Please sign in to comment.