cancel
Showing results for 
Search instead for 
Did you mean: 

How to stop unpaid orders?

How to stop unpaid orders?

Hi,

 

I'm new to Magento, and am just getting ready to launch my site, and I'm hoping someone can help with an issue that my testing has thrown up?

 

When a customer adds goods to their cart, and then proceeds to the checkout, the system seems to generate an order before the payment has been taken.  That means that if there is an issue with the payment, or the customer changes their mind, or the page times out, etc. I will be left with an unpaid order, and the customer won't be able to try again, if there was only one item in stock, as the initial order has already allocated that stock item.

 

Is there any way to stop the order being generated until the checkout process has been successfully completed?

 

Thanks

 

Dan

1 REPLY 1

Re: How to stop unpaid orders?

Hello @dan_holdway 

 

Order have to create before payment in some payment gateways because some payment gateways required order id and other parameters of order so to fix this problem you can create a observer class with public method to cancel pending order. Now call this method over the cron. You can setup cron time 5 min, 30 min or according to your requirements. 

 

Or you can use extensions: https://github.com/bitixel/magento2-auto-order-cancel

https://marketplace.magento.com/bsscommerce-auto-cancel-order.html

Try this, it will help you.

Manish Mittal
https://www.manishmittal.com/