This can happen when the customer reaches the payment page, but then returns back to the booking form via the back button: the browser remembers the URI with the cart slug, trying to make it ready, and then it fails because it is already pending. I did not like the idea of modifying a payment that is already not a draft, because it seems to me that can lead to errors if we receive Redsys notifications of payments that are being changed back to draft. In fact, i believe that draft payments maybe should go to a different relation altogether, so that i can prevent UPDATE on payment by guests, but maybe i am going overboard now.
Languages
PLpgSQL
69.3%
Go
25.1%
CSS
4.3%
JavaScript
0.8%
Scheme
0.4%