Only completed payments should be queried when processing payment

Created on 2 June 2025, 6 days ago

Problem/Motivation

In some cases can multiple payments be linked to an order, with different state. By ex: one was autorized but never completed, another was completed after.
The current processPayment method will not process the second completed payment and the order will not be placed.

Steps to reproduce

Proposed resolution

Add a condition to the query to filter completed payment only.

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Active

Version

1.0

Component

Code

Created by

🇫🇷France GuillaumePacilly

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @GuillaumePacilly
  • 🇨🇭Switzerland berdir Switzerland

    That's only correct if you have autocomplete enabled, otherwise they might be authorized only and that's the expected state.

    I'm unsure how you end up with multiple payments, they are only created if at least in authorized state and there shouldn't be a need to do another then?

    We just discussed kind of the opposite, that we should drop the return FALSE and return the payment we have, possibly depending on the state and autocomplete setting. That should in my opinion remove the need for those long sleep() calls on notify, because the loadForUpdate() should ensure that it will only have to wait as long as necessary and it's not a big deal then if notify goes first.

Production build 0.71.5 2024