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

[BUG] Inconsistency in which transaction / payment method in order is relevant #1488

Open
1 task done
fabianeichinger opened this issue Nov 27, 2024 · 0 comments
Open
1 task done
Labels
bug Something isn't working payment

Comments

@fabianeichinger
Copy link

fabianeichinger commented Nov 27, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

In scenarios where an order has multiple transactions (e.g. changing payment method after order), the computed paymentMethods in useOrderDetails and useOrderPayment often reference the wrong method. The implementations on which order transaction is considered relevant are inconsistent with the Shopware business logic and standard TWIG storefront.

Expected Behavior

The computed transaction / payment method should be relevant and consistent with Shopware.

Steps To Reproduce

  1. Create an order with payment method A, don't complete payment
  2. Switch payment method to method B with orderSetPayment post /order/payment
  3. Disable payment method A in Shopware Shop Settings

Result in Frontends:

  • paymentMethod from useOrderDetails is method A
  • activeTransaction and paymentMethod from useOrderPayment is null

Visible payment method in TWIG storefront: method B

Environment

Anything else?

The relevant transaction for useOrderDetails is probably the latest one. (See order.transactions|last.paymentMethod in https://github.com/shopware/shopware/blob/trunk/src/Storefront/Resources/views/storefront/page/account/order-history/order-detail.html.twig#L93-L105, not sure how this array is sorted though)

The relevant transaction for useOrderPayment maybe should take inspiration from https://github.com/shopware/shopware/blob/trunk/src/Core/Checkout/Payment/PaymentProcessor.php#L202-L225.

Related to discussion #1443

@fabianeichinger fabianeichinger added the bug Something isn't working label Nov 27, 2024
@BrocksiNet BrocksiNet moved this to Developer Backlog in Composable Frontends Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working payment
Projects
Status: Developer Backlog
Development

No branches or pull requests

2 participants