Get active payment methods in Magento 2.

In Magento 2 We can get only active payment methods using Magento\Payment\Model\Config class. You can get a list of all active payment method by Config.php class.

Return methods are both online and offline for a system. You can get it by simple code snippets.

Create Block file,

Call function in template file by below way,

Output is(Test in Magento 2.2.6),

You can get all payment methods in Magento 2 by, Get All Payment Methods in Magento 2.

 

One Reply to “Get active payment methods in Magento 2.”

Leave a Reply

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