From db5f153dc920c03dbded255611e7fabedadf218b Mon Sep 17 00:00:00 2001 From: Lukasz Mordawski Date: Wed, 18 Mar 2020 14:57:50 +0100 Subject: [PATCH] Add lookup user possibility --- source/Paysafe/MerchantAccountService.php | 24 +++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/source/Paysafe/MerchantAccountService.php b/source/Paysafe/MerchantAccountService.php index 14fd7f9..cdf9ef6 100644 --- a/source/Paysafe/MerchantAccountService.php +++ b/source/Paysafe/MerchantAccountService.php @@ -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; + } }