Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix order creation issues for logged-in customer #133

Closed

Conversation

ekuleshova
Copy link

We met with the issue in the Magento VIPPS payment module. It's not possible to place VIPPS order through Klarna Checkout if customer is logged in to Magento. The correct behavior is to create Magento order BEFORE the customer is redirected to Vipps payment page. But there is an issue in the code which prevents order creation for Magento logged-in customers, and the order for such customers is created only AFTER payment is done when the customer is redirected back to Magento.

Problem is in 2 places and it exists in the latest module version:

  1. $quote->getCheckoutMethod() function needs true argument in \Vipps\Payment\Controller\Payment\Klarna\InitRegular::placeOrder(quote), \Vipps\Payment\Controller\Payment\Klarna\InitRegular::setCheckoutMethod(quote) and \Vipps\Payment\Controller\Payment\InitExpress::initiatePayment(). Vipps module recognizes "customer", "guest" and "register" checkout methods. But for logged-in customer:
    $quote->getCheckoutMethod() = 'login_in';
    when
    $quote->getCheckoutMethod(true) = 'customer';
    (see \Magento\Quote\Model\Quote::getCheckoutMethod(originalMethod)).

  2. $this->paymentInformationManagement->savePaymentInformationAndPlaceOrder() for "customer" needs $quoteId, not $maskedQuoteId in \Vipps\Payment\Controller\Payment\Klarna\InitRegular::placeOrder(quote).

@ekuleshova ekuleshova marked this pull request as ready for review July 29, 2022 14:53
@voleye
Copy link
Collaborator

voleye commented Aug 22, 2022

@ekuleshova Thank you for your request. Issue was fixed in version 2.4.29

@voleye voleye closed this Aug 22, 2022
@voleye voleye added the done label Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants