Is there any possibility from the shop-system to perform a post redirection while clicking on the 'Place Order' button? We have tried posting the form data using the function getOrderPlaceRedirectUrl and there is an intermediate page (a blank page). Is it possible to eliminate such a page and perform a redirection (to the third-party site) while posting the values from the shop?
As an additional info, in the function getOrderPlaceRedirectUrl, we are using the internal controller URL with custom block like what have been followed with the PayPal Standard Payment.
Hi @prakashkpv,
Yes. You can do by using observer event sales_place_order_after. In that observer you can post the data & submit the form with action url.
Issue solved? give kudos & accept as solution
Best regards
Madhuresan
Bootsgrid
Hi Madhuresan,
Thanks for your suggestion. Could you please confirm the event (checkout_submit_all_after) and if possible give some examples how to handle in observer (perform a redirection while submitting the post values)?
Regards,
Prakash K
use Magento\Framework\App\ActionInterface; use Magento\Framework\Controller\ResultFactory; class YourClass implements ActionInterface { const REDIRECT_URL = 'https://example.com/index.html'; protected $resultRedirect; public function __construct(\Magento\Framework\Controller\ResultFactory $result) { $this->resultRedirect = $result; } public function execute() { $resultRedirect = $this->resultRedirect->create(ResultFactory::TYPE_REDIRECT); $resultRedirect->setUrl(self::REDIRECT_URL); return $resultRedirect; } }