PAYONE-GmbH / magento-2

PAYONE Payment Extension for Magento 2
28 stars 56 forks source link

Klarna Invoice - order with gift card not possible #344

Closed juules closed 3 years ago

juules commented 4 years ago

Hello Payone-team, today we ran into an issue when a gift card is applied in checkout and the payment method is Klarna Invoice. When trying to pay with Klarna Invoice in the final checkout step with a applied gift card an alert-box is displayed ("An error occured") and it is not possible to complete the checkout.

The following entry is added to Magento exception.log: Notice: Undefined index: authorized in .../vendor/payone-gmbh/magento-2/Model/Api/Invoice.php on line 203

Environment:

A quick test showed that the $giftCard['authorized'] is not defined in the quote, it looks like it is set later in the order process.

Can you please have a look at this problem? Thank you in advance and best regards

T-Kuchel commented 4 years ago

Hello @juules ,

here we had to investigate, why this is occurs. We will come back to you, when we have any finding or results.

Greetings from Kiel Timo

juules commented 4 years ago

Hello @T-Kuchel, do you have any new information regarding this issue?

Best regards, Julia

fjbender commented 4 years ago

For anyone wondering: Magento Gift Card behavior changed, and the amount of the gift card is not stored in the authorized but in the cleverly named ba property now. It can be quickly fixed by changing this in https://github.com/PAYONE-GmbH/magento-2/blob/95ac4e82d865934fff33d7a47107200ccba76f88/Model/Api/Invoice.php#L211

We're working on finding out if a backwards-compatible fix is possible.

fjbender commented 4 years ago

Okay, seems like the issue only arises in Magento 2.3.5. 2.3.4 and 2.4.x seem fine.

We have provided a PR #360 that fixes this issue.

@juules can you confirm?