From 0cd57207f137f0f70510f6d9b9bc0ebe1c4e737f Mon Sep 17 00:00:00 2001 From: Vasil Rangelov Date: Thu, 3 Oct 2024 11:32:55 +0300 Subject: [PATCH] Restored compatibility with PHP 5.4. Done so by removing the trailing function comma in WithdrawalRequestsTest (as this is PHP 8.0+), and replacing the spread operator (PHP 7.4+) usage in BaseService with array_merge(). --- src/Nuvei/Api/Service/BaseService.php | 18 +++++++++++------- tests/WithdrawalRequestsTest.php | 2 +- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/Nuvei/Api/Service/BaseService.php b/src/Nuvei/Api/Service/BaseService.php index 0ac9e09..2a55232 100644 --- a/src/Nuvei/Api/Service/BaseService.php +++ b/src/Nuvei/Api/Service/BaseService.php @@ -247,13 +247,17 @@ protected function call($params, $mandatoryFields, $endpoint, $checksumParameter { if (!$checksumParametersOrder && $processAdditionalParams) { $paramKeys = array_keys($params); - $checksumParametersOrder = [ - 'merchantId', - 'merchantSiteId', - ...$paramKeys, - 'timeStamp', - 'checksum' - ]; + $checksumParametersOrder = array_merge( + [ + 'merchantId', + 'merchantSiteId', + ], + $paramKeys, + [ + 'timeStamp', + 'checksum' + ] + ); } if (!$checksumParametersOrder) { $checksumParametersOrder = $mandatoryFields; diff --git a/tests/WithdrawalRequestsTest.php b/tests/WithdrawalRequestsTest.php index 78d7c9c..69eadca 100644 --- a/tests/WithdrawalRequestsTest.php +++ b/tests/WithdrawalRequestsTest.php @@ -68,7 +68,7 @@ public function testGetCandidatesForRefund() $this->assertThat($response, $this->logicalOr( $this->arrayHasKey('merchantId'), $this->arrayHasKey('merchantSiteId'), - $this->arrayHasKey('transactionsDetailList'), + $this->arrayHasKey('transactionsDetailList') )); $this->assertEquals('SUCCESS', $response['status']); }