I am Writing a Payment Gateway(Onsite) Plugin For Commerce 2, I am Stuck with Checkout Flow Step Transitions.
Let Me Explain: I am extending the OnsitePaymentGatewayBase and in the createPayment() Method I am setting the payment states to 'pending' [if the payment gateway accepted the request]and the payment state is setting well(no issues with payment state), Since My Payment Gateway is Async I need to implement onNotify() to change the payment state to 'completed'.
My Issue: Since Payment Gateway is Async(payment notification will be sent after a day) My order Sates also be needed to be in 'Pending' or something similar states but when I use default checkout flow I am getting the order completed even before the notification is processed. means after I checkout the order state is 'completed',
What I want: I want the order state to pending or review ..etc even after the checkout. only after the processing of notification the order state to be 'completed'
Or Simply: How can I set Order state to Pending or Review or darft..etc and Not 'completed' Only after receiving the Notification from Gateway, I have to set order state to completed