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

[AdminUI/Order/Refunds] Original payment method detection is incorrect #233

Closed
diimpp opened this issue Nov 30, 2020 · 1 comment
Closed
Labels
Enhancement Minor issues and PRs improving the current solutions (optimizations, typo fixes, etc.).

Comments

@diimpp
Copy link
Member

diimpp commented Nov 30, 2020

In case when there are multiple payment attempts in different states and possibly with different payment methods

{% set original_payment_method = order.payments.first().method %}

then this code doesn't work as intended and should be replaced with

{% set original_payment_method = order.lastPayment(constant('Sylius\\Component\\Core\\Model\\PaymentInterface::STATE_COMPLETED')).method %}

as something not outright broken.

Ideally it should be done as new provider and twig function, which can accommodate partial states as well.

image
image

@GSadee GSadee added the Enhancement Minor issues and PRs improving the current solutions (optimizations, typo fixes, etc.). label Jan 8, 2021
@GSadee
Copy link
Member

GSadee commented Jun 22, 2021

Fixed by #316

@GSadee GSadee closed this as completed Jun 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Minor issues and PRs improving the current solutions (optimizations, typo fixes, etc.).
Projects
None yet
Development

No branches or pull requests

2 participants