Skip to content

Commit

Permalink
Fix the issue with Klarna payments
Browse files Browse the repository at this point in the history
ISSUE: CS-6430
  • Loading branch information
filipkojic committed Feb 13, 2025
1 parent d56f38a commit 75285c2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Handlers/AbstractPaymentMethodHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,8 @@ public function pay(
$this->paymentStateDataService->deletePaymentStateDataFromId($storedStateData['id']);
}

$paymentMethodType = $stateData['paymentMethod']['type'];
$paymentMethodType = array_key_exists('paymentMethod', $stateData) ?
$stateData['paymentMethod']['type'] : '';
if ($paymentMethodType === RatepayPaymentMethod::RATEPAY_PAYMENT_METHOD_TYPE ||
$paymentMethodType === RatepayDirectdebitPaymentMethod::RATEPAY_DIRECTDEBIT_PAYMENT_METHOD_TYPE
) {
Expand Down Expand Up @@ -365,7 +366,7 @@ public function pay(
// Payment had no error, continue the process

// If Bancontact mobile payment is used, redirect to proxy finalize transaction endpoint
if ($stateData['paymentMethod']['type'] === 'bcmc_mobile') {
if (array_key_exists('paymentMethod', $stateData) && $stateData['paymentMethod']['type'] === 'bcmc_mobile') {
return new RedirectResponse($this->getReturnUrl($transaction));
}

Expand Down Expand Up @@ -821,7 +822,7 @@ private function getPaymentRequest(
$billieData = []
) {
$transactionId = $transaction->getOrderTransaction()->getId();
if ($billieData !== []) {
if (!empty($billieData)) {
$stateData['billieData'] = $billieData;
}

Expand Down

0 comments on commit 75285c2

Please # to comment.