Skip to content

Commit

Permalink
run rector
Browse files Browse the repository at this point in the history
  • Loading branch information
nuryagdym committed Mar 23, 2024
1 parent 805f9dc commit 8ed7280
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public function map3DPaymentData(array $raw3DAuthResponseData, ?array $rawPaymen
'eci' => null,
'tx_status' => null,
'cavv' => null,
'md_error_message' => !$this->is3dAuthSuccess($mdStatus) ? $raw3DAuthResponseData['mdErrorMsg'] : null,
'md_error_message' => $this->is3dAuthSuccess($mdStatus) ? null : $raw3DAuthResponseData['mdErrorMsg'],
'3d_all' => $raw3DAuthResponseData,
];

Expand Down Expand Up @@ -450,7 +450,7 @@ public function mapHistoryResponse(array $rawResponseData): array
*/
public function is3dAuthSuccess(?string $mdStatus): bool
{
return \in_array($mdStatus, ['1'], true);
return $mdStatus === '1';
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ public function mapHistoryResponse(array $rawResponseData): array
*/
public function is3dAuthSuccess(?string $mdStatus): bool
{
return \in_array($mdStatus, ['1'], true);
return $mdStatus === '1';
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ public function mapOrderHistoryResponse(array $rawResponseData): array
*/
public function is3dAuthSuccess(?string $mdStatus): bool
{
return \in_array($mdStatus, ['1'], true);
return $mdStatus === '1';
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ public function mapHistoryResponse(array $rawResponseData): array
*/
public function is3dAuthSuccess(?string $mdStatus): bool
{
return \in_array($mdStatus, ['1'], true);
return $mdStatus === '1';
}

/**
Expand Down
6 changes: 2 additions & 4 deletions src/Gateways/ToslaPos.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,8 @@ public function make3DPayPayment(Request $request, array $order, string $txType)
{
$request = $request->request;

if ($this->is3DAuthSuccess($request->all())) {
if (!$this->requestDataMapper->getCrypt()->check3DHash($this->account, $request->all())) {
throw new HashMismatchException();
}
if ($this->is3DAuthSuccess($request->all()) && !$this->requestDataMapper->getCrypt()->check3DHash($this->account, $request->all())) {
throw new HashMismatchException();
}

$this->response = $this->responseDataMapper->map3DPayResponseData($request->all(), $txType, $order);
Expand Down

0 comments on commit 8ed7280

Please sign in to comment.