Skip to content

Commit

Permalink
Add lookup user possibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukasz Mordawski committed Mar 18, 2020
1 parent b8aac75 commit db5f153
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 db5f153

Please sign in to comment.