openfun / joanie

👛 A headless ERP for education to manage course enrollment/subscription, payment and certificates delivery.
MIT License
20 stars 2 forks source link

Order stucked in submitted state #872

Open jbpenrath opened 3 days ago

jbpenrath commented 3 days ago

Bug Report

Problematic behavior

With the Lyra payment backend, some orders can be stucked in submitted state and we have to manually transition it to pending state.

Indeed, in several cases, Lyra is not able to notify Joanie when a payment fails. For example, if the user just initiate a payment then close its browser, no payment is created on Lyra and the frontend is not able to contact Joanie to abort the current payment.

Expected behavior/code

When a consumer fails to purchase or aborts a purchasement of a product, the order should be transitioned to pending state in all cases.

Possible Solution

  1. Check if we manage well payment failure notifications to transition orders from submitted to pending state
  2. Create a management command executed regularly to transition stucked orders.