title: What is the problem on payment retry with Sylius?
body: <p>I have a problem while implementing the payment process on my client website, using the <a href="https://github.com/sil-project/SyliusPayboxBundle" rel="nofollow noreferrer">SyliusPayboxBundle</a>:</p>
  
  <ol>
  <li>I start the payment process: A new <code>sylius_payment</code> entry (calling <strong>A</strong>) is created with the state <code>new</code></li>
  <li>I enter wrong card informations: The previous <code>sylius_payment</code> entry <strong>A</strong> is marked as <code>cancelled</code> and a new one is created  (calling <strong>B</strong>) with the state <code>new</code></li>
  <li>I enter good card informations: The entry <strong>B</strong> is deleted instead of being marked as <code>completed</code> as it's done when I use good card information on the first try, so I only have the <strong>A</strong> which is <code>cancelled</code></li>
  </ol>
  
  <p>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.</p>
  
  <p>In the Profiler, I see Doctrine queries.</p>
  
  <p>On the first <code>/payment/notify</code> (the bad card number): </p>
  
  <ul>
  <li>the creation of the <strong>B</strong> entry</li>
  <li>the update of the <code>state</code> and <code>details</code> of the entry <strong>A</strong></li>
  </ul>
  
  <p>On the second  <code>/payment/notify</code> (the good card number):</p>
  
  <ul>
  <li>the deletion of the entry <strong>B</strong></li>
  <li>the update of the <code>details</code> of the entry <strong>A</strong>, not the <code>state</code></li>
  </ul>
  
  <p>In the second call, I thought that entry <strong>A</strong> would not be changed and entry <strong>B</strong> would be updated with <code>completed</code> status. This is not the expected process?</p>