Technology ramblings of a pro breaker and fixer.
Categories

Magento Paypal orders automatically cancelling

After tearing my hair out for weeks working on a problem where no matter what i tried every time an order was placed on a customers magento website, where paypal was the selected payment gateway the order would always automatically cancel nearly immediately after the order was placed.

The logs werent helpful, and the magento order status notes would basically just say that the order was cancelled, and the customer notified. We noticed this was only occuring for paypal customers, other payment gateways would allow the order to go through as normal.

Initially we thought it must have been a database conflict after we had reset a bunch of test orders. We even went as far as a full magento re-install to try and fix the issue. All with no fix. 🙁

Finally one afternoon, i found the answer! And boy was it frustratingly simple (as it often is)

In the end the issue was with Paypal – not magento at all!

Paypal has a feature that is enabled by default. “Block accidental payments”

What does this do? PayPal states “You may prevent accidental payments by blocking duplicate invoice IDs”

So hows this affect us you ask?

In my customers case this wasn’t the first time they had used their paypal account for accepting orders through an online store, so the security feature above was jumping in and not allowing the payment to complete, this would then send the failed hit back to magento.

All because invoices with that reference number had been previously run through Paypal (even if it was for a totally different site). To fix it we simply disabled this option as it was the best for us. You do however have a few options depending on your situation.

Your options for a fix:

  1. Ensure each magento store is setting a unique invoice ref number, perhaps appending it with text storeid[invoiceid]
  2. Use an individual Paypal account for each magento store you intend on operating.
  3. Disable the feature in Paypal (easiest – this is the option we opted for)

Disabling the option in Paypal

If you head into your Paypal

  1. Select the profile option under the My account Menu
  2. Select My selling tools (in the left menu)
  3. Select the update option on the block payments section
  4. Select the “No, allow multiple payments per invoice ID”
  5. Save the options and exit paypal.
You should now find that you no longer find magento paypal orders are being automatically cancelled.
If this article has been of help to you, please let me know with a comment below.

3 Responses to “Magento Paypal orders automatically cancelling”

  • Allan - December 11, 2012 at 1:49 pm

    Do you happen to know if this could be the same problem if you are using Payflow Link to submit your payment? We’ve been having some phantom Magento Cancelled orders that seem to have no explanation.

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  • david - August 16, 2013 at 10:01 pm

    Hey, had the same problem so your article came in useful. Thanks vm. David

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  • DPhillips - November 16, 2016 at 8:52 pm

    Bless you!! 🙂

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)

Leave a Reply for DPhillips