craftcms / commerce

Fully integrated ecommerce for Craft CMS.
https://craftcms.com/commerce
Other
226 stars 170 forks source link

The Attempted Payments tab is showing the same order multiple times #602

Closed echantigny closed 5 years ago

echantigny commented 5 years ago

Description

When an order has multiple transactions that are not ending up in a "Paid" status, the order shows up multiple times in the Attempted Payments listing, once for each transaction. This should most likely be a "distinct" listing.

Steps to reproduce

  1. Make multiple failed attempts to pay an order.

Additional info

lukeholder commented 5 years ago

This looks like payment has just been attempted multiple times, as for creating new orders, could the Moneris gateway plugin be dropping the order ID before re-saving it?

eric-chantigny commented 5 years ago

@lukeholder @andris-sevcenko

I think you are misunderstanding the issue. The "attempted payment" listing seems to show the same order multiple times when there's multiple tries to pay for that same order. I'm just saying that the listing should not show an order for each failed attempt, just display it once and it will be less confusing for the admin. I don't want to see a listing of failed attempt, I just want to see orders with (one or +) failed attempts if not paid for.

lukeholder commented 5 years ago

@eric-chantigny is this still an issue?

eric-chantigny commented 5 years ago

@lukeholder I will do some testing and I will get back to you soon

echantigny commented 5 years ago

@lukeholder Yes, it is still an issue as of 2.1.2.

Each one of these entries link to the exact same detail page, in which you can see both transactions. I really think that the listing query just needs a Distinct on it.

2019-03-13 14_52_40-Orders - Commerce - Great Boardgames 2019-03-13 14_52_56-Cart 440648aa6ecc0f866a64865bc2e103e7 - Great Boardgames

andris-sevcenko commented 5 years ago

@eric-chantigny Agreed. As with all things, it's just a tad more complicated than it would appear at a glance :) (https://github.com/craftcms/commerce/blob/develop/src/elements/db/OrderQuery.php#L810)

andris-sevcenko commented 5 years ago

Looking into this.

echantigny commented 5 years ago

@andris-sevcenko Thank you! I confirm that this change fixes the issue.