From ec69557ea789110e191f39aef2a99a8be9de78ee Mon Sep 17 00:00:00 2001 From: Alex Lushpai Date: Tue, 13 Jun 2017 10:54:20 +0300 Subject: [PATCH] fix ordersPaymentEdit (#39) --- lib/RetailCrm/ApiClient.php | 2 +- tests/RetailCrm/Tests/ApiClientOrdersTest.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/RetailCrm/ApiClient.php b/lib/RetailCrm/ApiClient.php index e8a3678..73cca2e 100644 --- a/lib/RetailCrm/ApiClient.php +++ b/lib/RetailCrm/ApiClient.php @@ -474,7 +474,7 @@ class ApiClient * * @return ApiResponse */ - public function ordersPaymentEdit(array $payment, $by = 'externalId', $site = null) + public function ordersPaymentEdit(array $payment, $by = 'id', $site = null) { if (!count($payment)) { throw new \InvalidArgumentException( diff --git a/tests/RetailCrm/Tests/ApiClientOrdersTest.php b/tests/RetailCrm/Tests/ApiClientOrdersTest.php index 7ce9d1b..ca406be 100644 --- a/tests/RetailCrm/Tests/ApiClientOrdersTest.php +++ b/tests/RetailCrm/Tests/ApiClientOrdersTest.php @@ -402,6 +402,7 @@ class ApiClientOrdersTest extends TestCase ); $paymentEdit = array( + 'id' => $response['id'], 'externalId' => $externalId, 'amount' => 1500, 'comment' => 'test payment!',