I'm working on a payment plugin where I need to retrieve the redirection link from the payment partner.
I'm writing this logic in the "PostProcessPayment" method, but in this method I need to use an await-keyword to wait for the responds from the partner with the redirection link. However, instead of waiting the program jumps out of the "PostProcessPayment" method and continues in the check-out controller and therefore the "_webHelper.IsRequestBeingRedirected" is still false when it gets there. So no redirections are made.
How can I resolve this problem? I've tried removing the await keyword and using .GetAwaiter().GetResult() instead, but then the "OpcCompleteRedirectionPayment" in the check-out controller fails.