Magento 2 with charged twice or thrice but order not went through on frontend

I have Magento 2.3.2 version installed.

When we click on the place order button after filling up the credit card detail on payment gateway. It is showing error Invalid state change requested

This issue is not frequently producing but it is happening with some of the customers.

This API showing 400 HTTP status code.


Let me explain here step by step.

I have filled up credit card detail on the gateway and hitting on the PLACE ORDER button to do order it is showing me an Invalid state change requested as the error on the checkout page. Order success page not showing and stay on the checkout page but the credit card was charged and order placed on the database and showing on the admin panel.

If I will press again then it will be showing the same error and order went through on the admin panel but on the frontend order success page not showing.

This is happening for 2 to 4 times and finally order placed and redirect to the order success page.

This is happening with the payment gateway.

Anyone can help me with this issue to make a fix that would be a great help.

Thanks In Advance.