I am having a problem with PayPal WPS credit card payments. PayPal does not auto redirect credit card transactions back to your website as they do with PayPal account transactions. Unless the customer clicks the link to return to the website, the order does not complete and no user account is created and no subsequent rules are fired. PayPal sends the IPN back immediately several times, but I get two of these error messages:

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '' for key 'name': INSERT INTO {users} (uid, created, uuid) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array ( [:db_insert_placeholder_0] => 3113 [:db_insert_placeholder_1] => 1396472529 [:db_insert_placeholder_2] => 2b3db370-08d5-46ef-a15c-8e91558e95d3 ) in drupal_write_record() (line 7211 of /srv/bindings/dda0896d18754a4aa3468d4c89b416cb/code/includes/common.inc).

PayPal continues to periodically send the IPN which then triggers the above message again.

If the customer pays by credit card rather than PayPal account and then clicks the link to return to my website, the user account is created, the IPN then attaches to the order, and all the subsequent rules fire.

If the customer has an existing user account and/or uses their PayPal account to pay, the IPN is transmitted back to my site's confirmation page whether or not the customer clicks to return to the site or is redirected automatically, the user account is created if there was not one, and all subsequent rules fire.

What is causing the error and the accounts to not be created?