Skip to content

Commit

Permalink
SW-454: handle second redirect after authorization when shipping cost…
Browse files Browse the repository at this point in the history
…s increase
  • Loading branch information
Stefan Mueller committed Dec 18, 2024
1 parent ff145b9 commit b5f222e
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,17 @@ public function paypalv2expressAction()
$userData = $this->payoneUserHelper->getUserData();
$paymentConfig = $this->moptPayone__main->getPayoneConfig($paymentId);

$moptPaymentReference = $session['moptPaymentReference'];
if (!empty($moptPaymentReference)) {
$this->forward(
'finishOrder',
'MoptPaymentPayone',
null,
array('txid' => $session->txId, 'hash' => $session->moptPaymentReference)
);
return;
}

if ($paymentConfig['paypalExpressUseDefaultShipping']) {
$amount = $this->payoneUserHelper->getBasketAmount($userData) + $shippingCosts;
} else {
Expand Down Expand Up @@ -151,6 +162,7 @@ public function paypalv2expressabortAction()
->get('errorMessageUserAbort');
unset($session->moptPaypalv2ExpressWorkorderId);
unset($session->moptBasketChanged);
unset($session->moptPaymentReference);

$this->redirect(array('controller' => 'checkout', 'action' => 'cart'));
}
Expand All @@ -161,6 +173,7 @@ public function paypalv2expresserrorAction()
$session->moptPayoneUserHelperErrorMessage = $this->moptPayone__paymentHelper->moptGetErrorMessageFromErrorCodeViaSnippet(false, $this->request->getParam('errorCode'));
unset($session->moptPaypalv2ExpressWorkorderId);
unset($session->moptBasketChanged);
unset($session->moptPaymentReference);
$this->redirect(array('controller' => 'checkout', 'action' => 'cart'));
}
}

0 comments on commit b5f222e

Please sign in to comment.