I'm working on a new type of payment gateway with these steps: 1. The client is redirected to the payment gateway. 2. Client returns from payment gateway with payment information BUT THE PAYMENT CAN BE FAILED OR REJECTED, so no action should be done with the order. 3. Payment gateway provider sends a notify (onNotify method) information and only when the payment should be created OR confirmed.
What I have noticed that when onReturn is triggered the order state changes to the next one (In my case to completed) and that is wrong because onReturn in this payment provider changes nothing. It just should add a log message to the order.
Maybe there is a way to disable onReturn method trigger for next order state initiation? Or there is another endpoint just for my case?