Adyen / adyen-magento2

Adyen Payment plugin for Magento2
MIT License
155 stars 211 forks source link

Placing order with Klarna, Clearpay payment through GraphQL removes cart before payment is completed (Plugin v9) #2500

Closed rcbello closed 9 months ago

rcbello commented 9 months ago

Describe the bug In a headless implementation using graphql, calling placeOrder mutation on cart with Klarna or Clearpay payment makes it inaccessible even before payment is completed or adyenPaymentDetails mutation is called. After placeOrder mutation, calling cart query with cart id returns 'Cart is inactive' error. And, calling customerCart returns a new empty cart. Calling adyenPaymentDetails with payment data, order number and cart id also results in inactive cart error, so payment cannot be completed. This doesn't happen for Paypal or Credit Card with 3DS2 which follow the same flow.

To Reproduce Steps to reproduce the behavior:

  1. Prepare a customer cart for payment, add product, set shipping address, shipping method and billing address.
  2. Call setPaymentMethodAndPlaceOrder with klarna or clearpay payment method, and placeOrder in a single graphql mutation.
  3. placeOrder response will be an order with isFinal=false and additional action that needs to be completed. Order with pending status will be created.
  4. Complete payment by calling adyenPaymentDetails with action result, order number, and cart id.
  5. 'Cart is inactive' error will be returned. And, original cart will be inaccessible.

Expected behavior Original customer cart should still be accessible and payment can be completed by calling adyenPaymentDetails mutation.

Magento version 2.4.6-p2

Plugin version 9.0.7

Additional context We're using graphql api for our native iOS and Android apps. Doesn't happen for Adyen Paypal payment method and Klarna used to work in plugin v8.

dimitriBouteille commented 9 months ago

Same issue :) https://github.com/Adyen/adyen-magento2/issues/2478

candemiralp commented 9 months ago

Hello @rcbello,

Thanks for creating this issue. As @dimitriBouteille mentioned, this Github issue is a duplicate of #2478 and we are currently handling it.

I am closing this duplicate issue. Please feel free to follow-up the issue from the original issue.

Best Regards, Can