Skip to content

Commit

Permalink
Mark order payment as canceled for unsupported responses
Browse files Browse the repository at this point in the history
ISSUE: CS-3227
  • Loading branch information
goran-stamenkovski-logeecom committed May 27, 2022
1 parent f77edd8 commit 9018de4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Controllers/Frontend/Adyen.php
Original file line number Diff line number Diff line change
@@ -243,6 +243,7 @@ private function handlePaymentData($paymentInfo): void
!$resultCode->equals(PaymentResultCode::authorised()) &&
!$resultCode->equals(PaymentResultCode::identifyShopper()) &&
!$resultCode->equals(PaymentResultCode::challengeShopper()) &&
!$resultCode->equals(PaymentResultCode::pending()) &&
!$resultCode->equals(PaymentResultCode::redirectShopper())
) {
$this->handlePaymentDataError($paymentInfo);
@@ -262,6 +263,11 @@ private function handlePaymentDataError(array $paymentResponseInfo): void
{
if (array_key_exists('merchantReference', $paymentResponseInfo)) {
$this->basketService->cancelAndRestoreByOrderNumber($paymentResponseInfo['merchantReference']);
return;
}

if (isset($paymentResponseInfo['action']['merchantReference'])) {
$this->basketService->cancelAndRestoreByOrderNumber($paymentResponseInfo['action']['merchantReference']);
}
}
}

0 comments on commit 9018de4

Please sign in to comment.