From dbf4c9267ab5c6d7c54dab18cadc78fe9d5df587 Mon Sep 17 00:00:00 2001 From: curse89 <58438482+curse89@users.noreply.github.com> Date: Mon, 27 Nov 2023 15:06:47 +0300 Subject: [PATCH] Add method to get of currencies list (#182) --- lib/RetailCrm/Methods/V5/References.php | 18 ++++++++++++++++++ .../Version5/ApiClientReferenceTest.php | 3 ++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/lib/RetailCrm/Methods/V5/References.php b/lib/RetailCrm/Methods/V5/References.php index 9693805..42baf83 100644 --- a/lib/RetailCrm/Methods/V5/References.php +++ b/lib/RetailCrm/Methods/V5/References.php @@ -284,4 +284,22 @@ trait References ['unit' => json_encode($unit)] ); } + + /** + * Get a list of currencies + * + * @throws \InvalidArgumentException + * @throws \RetailCrm\Exception\CurlException + * @throws \RetailCrm\Exception\InvalidJsonException + * + * @return \RetailCrm\Response\ApiResponse + */ + public function currenciesList() + { + /* @noinspection PhpUndefinedMethodInspection */ + return $this->client->makeRequest( + '/reference/currencies', + "GET" + ); + } } diff --git a/tests/RetailCrm/Tests/Methods/Version5/ApiClientReferenceTest.php b/tests/RetailCrm/Tests/Methods/Version5/ApiClientReferenceTest.php index 1d50196..33148fb 100644 --- a/tests/RetailCrm/Tests/Methods/Version5/ApiClientReferenceTest.php +++ b/tests/RetailCrm/Tests/Methods/Version5/ApiClientReferenceTest.php @@ -184,7 +184,8 @@ class ApiClientReferenceTest extends TestCase ['stores'], ['couriers'], ['costs'], - ['units'] + ['units'], + ['currencies'], ]; }