Magento – Duplicate Order for one payment through Paypal Express Checkout

magento-1.9order-duplicationpaypal-express

Duplicate order on Magento v 1.9.1.0., triggered by:

PayPal API error code 10486

In short, the site responds to this error appropriately and as said in the doc: when the buyer's first payment is denied, the buyer is redirected back to PayPal.

(PayPal has confirmed this behavior, and told me to contact the developers in charge of this extension to report on this issue).

The problem seems to be linked to that redirection, which creates two orders in Magento (the two payment attempts — the first being denied by PayPal — are interpreted as two different orders/invoices. The buyer is charged once.).

Thus, in the backend (Sales > Orders) we can see for the same transactionid (PayPal) :

  • 2 different order ID numbers (magento)
  • 2 different correlationid
  • a « Completed » vs. « completed » payer address status (different syntax)
  • an « IPN "Completed" » comment noticed on the first order

What could be done to solve this?

Thanks for helping!

Best Answer

This is really a bug and should be fixed (we get this occasionally). But the workaround we use, which does not appear to break anything, at least in our case, is:

  • Look at each of the orders, especially the invoices tab
  • Accept the order with the correct invoice amount (in our case it has always been the one with higher increment_id)
  • Delete the incorrectly sized invoice directly from database (tables sales_flat_invoice and sales_flat_invoice_grid)
  • Delete the order directly from database (tables sales_flat_order and sales_flat_order_grid)
  • Manually verify the stock status of the products included in the order
Related Topic