• Hi,

    We sometimes receive orders with the status failed even though the customer has paid for the order. After some research, it seems that this is due to WooCommerce’s order expiration time (60 minutes by default).

    Increasing this time is not a solution, as we don’t want to tie up stock for too long, and our orders are closed on a given date. In our case, we would prefer not to receive payment after this time, but to keep it at 60 minutes.

    We would therefore like to block and not receive payment when the deadline has passed.

    I have two questions:

    1. Is it possible to do this with custom development or otherwise?
    2. Could a long payment confirmation response time from Stripe also be the cause of this problem?

    Thanks in advance

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Payment Plugins

    (@mrclayton)

    Hi @jeanbon75

    The most likely cause for this issue is you have a 3rd party plugin or custom code that’s triggering a PHP error after payment is received but before the order’s status gets updated by WooCommerce. When a payment is processed successfully, the Stripe plugin calls the WC_Order::payment_complete method.

    That WooCommerce provided method updates the order’s status so as to prevent the behavior you’re experiencing. But if any 3rd party code triggers an error, it can prevent the order’s status from being updated from the pending state.

    I recommend taking a look at your WooCommerce > Status > Logs and see if there is a fatal-errors log file.

    Kind Regards

    Thread Starter jeanbon75

    (@jeanbon75)

    Hi,

    I don’t think that’s the reason you gave. In fact, the orders affected by this problem have the same message (in the order detail notes): “Unpaid order cancelled – time limit reached. Order status changed from Waiting for payment to Cancelled.”

    This is clearly not a php error. The payment has been received, so the time limit has been exceeded. How can I avoid this?

    Thanks for your feedback

    Plugin Author Payment Plugins

    (@mrclayton)

    I don’t think that’s the reason you gave.

    I don’t understand what you mean here. I provided a thorough description of what the issue could be including an explanation of how WooCommerce updates the order status after payment is processed.

    This is clearly not a php error.?

    Can you explain your reasoning here? Did you check your logs for the existence of the fatal-errors log file?

    The payment has been received, so the time limit has been exceeded.

    Please see my previous reply to this thread where I explained that the order status is updated after the payment is processed. Therefore, it’s entirely possible that a PHP error can happen after the payment is processed but before the order’s status gets updated from pending to processing/completed.

    If this was for a non-card payment, check that your webhook is working correctly. You can verify that via the stripe.com > developers > webhooks page.

    Kind Regards

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.