cancel
Showing results for 
Search instead for 
Did you mean: 

How to placeOrder, then redirect to remote payment gateway?

How to placeOrder, then redirect to remote payment gateway?

I'm building a payment method where the user needs to POST a form with order data to the remote payment gateway, thereby leaving the Magento environment.

 

The workflow is:

- placeOrder (save order with status pending or new)

- POST custom order form to remote gateway, which also redirects the user there

- upon return, the order is updated (or via remote call in the background)

 

I'm stuck with the second step: redirecting the user AFTER saving the order first (we need the orderIncrementId). I found this outdated help: 

https://stackoverflow.com/questions/33416686/magento-2-no-redirect-to-external-payment-provder

 

What is the Magento 2 "proper way" to do this? Is there an official way?