When I set payment methods to ‘Authorize and Capture’ (tried authorize.net, paypal, and others) I get a server failure notice on the website. The error and exception logs show an integrity constraint violation on ‘SALES_INVOICE_ORDER_ID_SALES_ORDER_ENTITY_ID’ which is a core magento foreign key constraint. ‘Authorize Only’ creates a sales order, which works fine, but ‘Authorize and Capture’ creates an invoice and tries to reference the sales order, which doesn’t exist at this point… but it should exist here. I can’t see anything in the logs, showing what is wrong in creating the order. How do I go about debugging this?