In Magento 1 we define the getOrderPlaceRedirectUrl in the model which extends Mage_Payment_Model_Method_Abstract
and redirect to a particular controller after checkout submit.
Then from the controller we call $this->getResponse()->setBody($this->getLayout()->createBlock('someblock')->toHtml())
and inside the block we create a form with post data and redirect to a 3rd party payment gateway.
In Magento 2 I heard that getOrderPlaceRedirectUrl is not available and I'm unable to understand how it is handled.
Can someone please guide me to achieve the above scenario in Magento 2.1?
Best Answer
You need to override the placeOrder function in your method-render JS function.
The key is here
afterPlaceOrder
function. You should redirect to your save action here.