Skip to content

Commit

Permalink
Merge pull request #2 from lukasz-mordawski/add-lookup-user-possibility
Browse files Browse the repository at this point in the history
Add lookup user possibility
  • Loading branch information
cb-vova authored Mar 18, 2020
2 parents b8aac75 + db5f153 commit db48b88
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions source/Paysafe/MerchantAccountService.php
Original file line number Diff line number Diff line change
Expand Up @@ -459,4 +459,28 @@ function createMerchant(Merchant $merchant)

return new Merchant($response);
}

/**
* Lookup merchant account users
*
* @return array
* @throws PaysafeException
*/
public function lookupUsers()
{
$request = new Request(array(
'method' => Request::GET,
'uri' => $this->prepareURI('/accounts/' . $this->client->getAccount() . '/users')
));
$response = $this->client->processRequest($request);
if (empty($response['users'])) {
return [];
}

$returnData = [];
foreach ($response['users'] as $user) {
$returnData[] = new User($user);
}
return $returnData;
}
}

0 comments on commit db48b88

Please sign in to comment.