Skip to content

Commit

Permalink
Fix the issue with Klarna payments
Browse files Browse the repository at this point in the history
  • Loading branch information
Tamara committed Dec 26, 2024
1 parent beb47b3 commit 8a5e16f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@

#composer
vendor/
/.github/test-report/
/.github/workflows/e2e/adyen-integration-tools-tests/projects/shopware/test-results/
/test-report/
7 changes: 4 additions & 3 deletions src/Handlers/AbstractPaymentMethodHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,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 @@ -364,7 +365,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 @@ -776,7 +777,7 @@ private function getPaymentRequest(
$billieData = []
) {
$transactionId = $transaction->getOrderTransaction()->getId();
if ($billieData !== []) {
if (!empty($billieData)) {
$stateData['billieData'] = $billieData;
}

Expand Down

0 comments on commit 8a5e16f

Please sign in to comment.