Cart Items are deleted after fail checkout magento2.2.1
Summary of the issue
When I try to place an order with all the required information filled in and choose the mode of payment as PayUmoney payment Gateway then post click of Place order button, it redirects me to Payumoney popup. If I cancel the transaction on reaching this stage then in Magento Admin Panel it shows in an ordered list with the order payment status as"pending payment" which should not be the case. Instead, it should show canceled status without affecting the inventory.
Steps to reproduce
Add item to cart
Proceed to checkout
Checkout using Credit/Debit card.
Refresh/go back page, cancel payment, failed payment
if refreshed page/go back - item should still be in still in the cart
cancel/failed payment - give options to try again or even choose a different payment method.
clears item and redirects to an empty page (nothing is in your shopping cart)