What is the problem on payment retry with Sylius?

112 Views Asked by At

I have a problem while implementing the payment process on my client website, using the SyliusPayboxBundle:

  1. I start the payment process: A new sylius_payment entry (calling A) is created with the state new
  2. I enter wrong card informations: The previous sylius_payment entry A is marked as cancelled and a new one is created (calling B) with the state new
  3. I enter good card informations: The entry B is deleted instead of being marked as completed as it's done when I use good card information on the first try, so I only have the A which is cancelled

The default state machine is not override, I don't understand why this is happening and my order is blocked in an unstable state: Sylius allows a new payment attempt, but the bank block it because in reality the payment was validated on the second attempt.

In the Profiler, I see Doctrine queries.

On the first /payment/notify (the bad card number):

  • the creation of the B entry
  • the update of the state and details of the entry A

On the second /payment/notify (the good card number):

  • the deletion of the entry B
  • the update of the details of the entry A, not the state

In the second call, I thought that entry A would not be changed and entry B would be updated with completed status. This is not the expected process?

0

There are 0 best solutions below