I developend an Action, which is called via AJAX to create an user (if not existing) and finishing his order.
This basically works great, for the first time. If i want to do another purchase within the same session, it fails.
at this point
$checkout->savePayment(array('method'=>'epay_shared'));
SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`databasname/sales_flat_quote_payment`, CONSTRAINT `FK_SALES_QUOTE_PAYMENT_SALES_QUOTE` FOREIGN KEY (`quote_id`) REFERENCES `sales_flat_quote` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE)
Please see code attached.
Looking for someone helping me out to fix this, payment will be only done when your bugfix/solution is really working. Please do only bid, if you have Magento coding experience (not themes only!!!)