How to Make a Payment Method Visible Only to Admin in Magento 2

Magento 2 supports number of payment methods to allow customers pay online. But at times, the admin may have set up the collaboration with the customers in such a way that they pay directly through cash, cheque or bank transfer method and the admin places orders on behalf of those customers. In such a case, the admin require to enable such payment methods only in the Magento 2 backend and not in the frontend for the customers.

The default Magento 2 does not provide any such functionality to make a payment method visible only to admin and invisible in the frontend. To satisfy the above scenario, I’ve come up with a method to make a payment method visible only to admin in Magento 2. Using this method, the payment method won’t be visible on the frontend to the customers.

Method to Make a Payment Method Visible Only to Admin in Magento 2

    1. Create events.xml at app/code/Vendor/Extension/etc/
    2. Create PaymentMethodAvailable.php at app/code/Vendor/Extension/Observer/

Using the code mentioned above, you can make a payment method only visible to the admin and invisible to the customers in the frontend.

Same way, as an admin, you may require to restrict payment methods in frontend. You can explore Magento 2 Payment Restrictions extension by Meetanshi to create condition based payment rules for restricting payment methods in frontend.

You can always post any doubts about the blog in the comments section below. I’d be happy to help 🙂

Do share the post with others in the community via social media!

Do not forget to rate the post with 5 ⭐ if found useful!

Thanks for reading!

4.8
(based on 8 Reviews)
How to Make a Payment Method Visible Only to Admin in Magento 2Author Magento Badge

Jignesh Parmar

An expert in his field, Jignesh is the team leader at Meetanshi and a certified Magento developer. His passion for Magento has inspired others in the team too. Apart from work, he is a cricket lover.

Leave a Reply

Your email address will not be published. Required fields are marked *