Menu Close
    Start a Project Request quote Reading list Switch to dark mode
    magento-hyperlocal-marketplace-guide

    List all active payment methods list magento2

    Today we are discussing how to get list of all payment methods which are active in Magento2.

    To get this you can use following code:


    Here,

    $_appConfigScopeConfigInterface is an object of Magento\Framework\App\Config\ScopeConfigInterface class.

    $_paymentModelConfig is an object of Magento\Payment\Model\Config class.

    and in toOptionArray() function we use a method: getActiveMethods() which returns model of all the active methods.

    In return array we have all payment methods with their code and title.

    Hope it will help you. Thank you.

    . . .

    Comment

    Add Your Comment

    Be the first to comment.

    Back to Top
    css.php
    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
    Close