i am trying to redirect a user to a custom offline payment method that i have created form one of my phtml file using a button click.

my payment method name is pay by cash.

I have a template where i am listing all the orders.

I want to redirect user to the Pay by Cash payment method and automatically do a place order by Pay by cash method on button click.

please help ! how i can do that.

1 Answer 1


in your "method-renderer" you can redirect to your controller action and from there you can render you phtml template :

file location :


code example :

return Component.extend({
       defaults: {
           template: 'compnay_method/payment/paybycash',
                redirectAfterPlaceOrder: false

         /** Returns send check to info */
         getMailingAddress: function() {
             return window.checkoutConfig.payment.checkmo.mailingAddress;
         afterPlaceOrder: function (data, event) {
             // Redirect to your controller action after place order button click



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.