Skip to content

Commit

Permalink
fixes after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
mustapayev committed Nov 16, 2024
1 parent 21629cb commit 07ed472
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -353,13 +353,17 @@ public function create3DFormData(AbstractPosAccount $posAccount, array $order, s
*/
public function createCustomQueryRequestData(AbstractPosAccount $posAccount, array $requestData): array
{
$dateTime = $requestData['requestDateTime'] ?? $this->createDateTime();
if (isset($requestData['requestDateTime'])) {
$dateTime = $requestData['requestDateTime'];
} else {
$dateTime = $this->valueFormatter->formatDateTime($this->createDateTime(), 'requestDateTime');
}

return $requestData
+ $this->getRequestAccountData($posAccount)
+ [
'version' => self::API_VERSION,
'requestDateTime' => $this->valueFormatter->formatDateTime($dateTime, 'requestDateTime'),
'requestDateTime' => $dateTime,
'randomNumber' => $this->crypt->generateRandomString(),
];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public function createCustomQueryRequestData(AbstractPosAccount $posAccount, arr
{
$requestData += $this->getRequestAccountData($posAccount) + [
'rnd' => $this->crypt->generateRandomString(),
'timeSpan' => $this->newTimeSpan(),
'timeSpan' => $this->valueFormatter->formatDateTime($this->newTimeSpan(), 'timeSpan'),
];

if (!isset($requestData['hash'])) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ public static function createCustomQueryRequestDataDataProvider(): \Generator
'clientId' => '1000000494',
'hash' => '12fsdfdsfsfs',
'rnd' => 'rndsfldfls',
'timeSpan' => '20241103144302',
'timeSpan' => new \DateTimeImmutable('2024-11-03 14:43:02'),
],
];

Expand All @@ -275,15 +275,14 @@ public static function createCustomQueryRequestDataDataProvider(): \Generator
'clientId' => '1000000494xx',
'hash' => '12fsdfdsfsfsxxx',
'rnd' => 'rndsfldfls',
'timeSpan' => '20241103144302',
],
'expected' => [
'apiUser' => 'POS_ENT_Test_001xxx',
'bin' => 415956,
'clientId' => '1000000494xx',
'hash' => '12fsdfdsfsfsxxx',
'rnd' => 'rndsfldfls',
'timeSpan' => '20241103144302',
'timeSpan' => new \DateTimeImmutable('2024-11-03 14:43:02'),
],
];
}
Expand Down

0 comments on commit 07ed472

Please sign in to comment.