Skip to content

Commit

Permalink
PAYOSWXP-144: change hashing of key
Browse files Browse the repository at this point in the history
  • Loading branch information
rommelfreddy authored and janteuber committed Jun 18, 2024
1 parent bd02f8e commit 8572e54
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Payone/RequestParameter/RequestParameterFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private function createRequest(array $parameters): array
}

$this->generateParameterHash($parameters);
$parameters['key'] = hash('md5', (string) $parameters['key']);
$parameters['key'] = hash('sha384', (string) $parameters['key']);

return array_filter($parameters, static fn ($value) => $value !== null && $value !== '');
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Payone/RequestParameter/RequestParameterFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function testItReturnsCorrectRequestParametersWithKey(): void

Assert::assertArraySubset(
[
'key' => hash('md5', 'value'),
'key' => hash('sha384', 'value'),
'key-1' => 'value-1',
'key-2' => 'other-value',
'key-3' => 'value-3',
Expand Down Expand Up @@ -128,7 +128,7 @@ public function testItFiltersParametersForGetFileRequest(): void

Assert::assertArraySubset(
[
'key' => hash('md5', 'value'),
'key' => hash('sha384', 'value'),
'key-1' => 'value-1',
],
$parameters
Expand Down

0 comments on commit 8572e54

Please sign in to comment.