title: Checkout and customer registration fails when customer is registering during checkout
body: <p>I'm having a problem with my Magento storefront where customers who register with my store during checkout cannot complete the OnePageCheckout checkout process. This error is rare and hard for me to reproduce. Here are the error messages I get:</p>
  
  <blockquote>
  Payment Transaction Failed Reminder<br>
  Payment transaction failed. Reason: Customer email is required.<br>
  <br>
  Payment Transaction Failed Reminder<br>
  Payment transaction failed. Reason: This customer email already exists.<br>
  </blockquote>
  
  <p>I'm pretty sure that this means the customer tried a second time, and couldn't complete the second checkout either.</p>
  
  <p>This error is strange to me for two reasons. First of all, that error should never happen at this point in checkout; since the validation on the one page checkout does not allow you to register with an email address that already exists, the second kind of error should be impossible. The validation checks also won't let you go any further without entering an email address at all (the first kind of error). In both cases the final payment tab, which seems to be where the error is encountered, should be hidden via JavaScript.</p>
  
  <p>How is it possible that a customer gets all the way to the point where they can click the Place Order button, but didn't get screened by the validation on the registration tab?</p>
  
  <p>My guess is that it could be a browser that causes the validation to not work, and lets the customer get all the way to the last bit.</p>
  
  <p>When I say this error is "rare," I mean that it happens with something like 2 out of 1000 orders. </p>
  
  <p>I am pretty sure it happens when the Quote gets converted to an Order. On the Order Save event, it will try and save the customer, as part of the transaction, while also processing the payment. I don't think the payment gateway is throwing the error, but maybe control was passed on to that class. It most likely happens just after the <code>saveOrderAction()</code> function is called in the <code>OnePageController.php</code> file. After an error gets thrown in this function, the error gets reported like this in the stack trace:</p>
  
  <pre><code>Mage::helper('checkout')-&gt;sendPaymentFailedEmail($this-&gt;getOnepage()-&gt;getQuote(), $e-&gt;getMessage());
  </code></pre>
  
  <p>This is where the "Payment Transaction Failed Reminder" email gets generated. I think that the error has to be in this part:</p>
  
  <pre><code>$this-&gt;getOnepage()-&gt;saveOrder();
  </code></pre>
  
  <p>How can I go about finding where in the PHP code this error occurs? How can I correct this so that I don't lose customers who're in the process of trying to purchase from me?</p>
  
  <p>My storefront is running on Magento version 1.9.1.1. </p>
  
  <p><strong>Update:</strong> Just got another one of these. The customer record is completely missing, but there is a shipping and billing address. Very strange.</p>