• Resolved Sara Die Webmacherin

    (@larvafashion)


    We are using Paypal Payments in our webshop. Sometimes we have failed payments because of a duplicate order ID.

    The problem is that these orders get the status Failed, but will never switch to Canceled.

    This means stock is reduced, but never increased again. So with a few failed payments we have completely inaccurate stock.

    Should it switch to Canceled automatically, or is there another workflow we should use?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Krystian

    (@inpsydekrystian)

    Hello @larvafashion

    Thanks for reaching out to us, we’re here to help.

    The error?DUPLICATE_INVOICE_ID?error is a security feature from?PayPal which aims to prevent accidental double-payments.

    PayPal Payments automatically sets an “invoice prefix” and then sends the WooCommerce order numbers in the pattern “invoice prefix+ordernumber” to PayPal.
    So when your prefix is set to “cfbdg-” and your order number is “123”, PayPal Payments sends the invoice ID “cfbdg-123” to PayPal.

    Under certain circumstances, for example when you restore a backup from your website, it is possible that the most recent WooCommerce orders do not exist anymore after the restore.
    So as soon as WooCommerce attempts to create a new order with the number 123 and the same invoice prefix, PayPal would throw this error to prevent accidental double payments because there is already a payment at PayPal with the same invoice ID.
    This feature can be disabled, though we usually recommend keeping it enabled. To disable it, follow these steps:

    1. Log in to your Business PayPal account (https://www.paypal.com/businessmanage/preferences/payments)
    2. Go to the?Payments Preferences?section
    3. Under the “Block accidental payments:” section, select the option “No, allow multiple payments per invoice ID

    With this feature disabled,?PayPal would no longer complain when you submit an invoice number that already exists in the system. But instead of disabling this feature, it would be better to figure out the true cause of this error. A buyer should not encounter this error during the normal checkout process.

    Kind regards,
    Krystian

    Thread Starter Sara Die Webmacherin

    (@larvafashion)

    Hello Krystian,

    I know what the duplicate invoice ID error is and we want to keep that security feature. We have a very high volume of orders and mostly the error occurs due to user behaviour (so nothing we can do about that).

    The problem is with the order status. A failed state should either not reduce the stock, or it should be canceled automatically after a certain time, so the stock will be restored.

    How is the plugin supposed to work in this regard?

    Regards,
    Sara

    Plugin Support Krystian

    (@inpsydekrystian)

    Hello @larvafashion

    We’d like to determine if this issue only occurs with orders initiated through PayPal Payments, as our plugin shouldn’t affect this. Could you please try to reproduce the problem using a different plugin or a dummy payment method?

    Also, WooCommerce doesn’t reserve stock for orders with Pending Payment or Failed status: Managing Orders – Order Statuses.

    I just created a failed PayPal Payments order, and it did not reduce the stock.

    Looking forward to hearing from you.

    Kind regards,
    Krystian

    Thread Starter Sara Die Webmacherin

    (@larvafashion)

    Hello Krystian,

    Thank you for confirming that “failed” order status shouldn’t reduce stock.

    We have a lot of hacky custom code that interferes with stock and I’m in the process of getting rid of it. Unfortunately in this process I break a lot of order processes.

    You can mark this issues as resolved, since your plugin is most probably not a fault.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Payment failed but never canceled’ is closed to new replies.