Menu Close
    Start a Project Request quote Reading list Switch to dark mode

    Redirect to third party link after order place magento2

    If in your magento, you have created a custom payment method, and using payment API for the transaction, and want to redirect to custom url after order place to complete transaction then, you can use following process.

    Here is a blog to create custom payment method in magento2.
    Blog link
    Now in payment method file add following code:

    file path: app/code/Test/Testpayment/view/frontend/web/js/view/payment/method-renderer/testpayment.js

    Now, create set payment method action file:

    file path: app/code/Test/Testpayment/frontend/web/js/action/set-payment-method-action.js


    In testpayment.js, we define,

    redirectAfterPlaceOrder : false, it means we set default redirection to false.

    setPaymentMethodAction: call to set payment method, so, this is your custom file and when your custom payment is got selected then your set-payment-action file get called.

    In set-payment-method-action.js file,

    we set redirect url to our custom payment method.


    After this, flush the cache, and execute the code, and after order place your custom url get executed.

    Hope this blog helps you to add functionality in magento2.

    Thank you.



    . . .

    Comment (1)

    Add Your Comment

  • Viet duong
    Thank a lot,
    I am a newbie in Magento2,
    I need to post Form and get Response to third party after order placed. please help
  • Back to Top
    Hire Us!
    Brief us about your requirements and we'll get back to you.
    Woo! Hooy!
    We have just recieved your project brief and our expert will contact you shortly.
    Send Again