Magento 2 – Payment Method List

magento2payment-methods

Does anyone have a list of Payment Method codes that I could use? There are questions out there saying to use Dependency Injection to discover the codes however, my module does not use Frontend or Backend so I can't view PHP echo's. As far as i'm aware there are no payment methods on the server additional to the original payment methods.

So far I have found "checkmo" as the Check / Money Order payment method and "purchaseorder" but I can't find anything else. I am mainly after the Bank Transfer payment code.

Best Answer

Here is the list of all default payment method codes. (Generally all are inactive)

free
substitution
vault
paypal_express
paypal_express_bml
payflow_express
payflow_express_bml
payflowpro
payflowpro_cc_vault
paypal_billing_agreement
payflow_link
payflow_advanced
hosted_pro
checkmo
purchaseorder
banktransfer
cashondelivery
authorizenet_directpost
braintree
braintree_paypal
braintree_cc_vault
braintree_paypal_vault
amazon_payment
amazonlogin
ayanlabs_paypalpro
klarna_kp
amazon_payments
paypal_payment_pro
wps_express
wps_express_bml

If you want to get list and information of all available payment methods on magento programatically you can use below mention code and you will get all payment method information.

You need to create a php file in your magento root example Magento_Root/listpaymentmethods.php and add below mention code and run that php script by your url http://www.yourstore.com/listpaymentmethods.php

<?php
use Magento\Framework\App\Bootstrap;
require __DIR__ . '/app/bootstrap.php';
$params = $_SERVER; 
$bootstrap = Bootstrap::create(BP, $params);
$objectManager = $bootstrap->getObjectManager();
$state = $objectManager->get('Magento\Framework\App\State');
$state->setAreaCode('frontend');

$scope = $objectManager->create('\Magento\Framework\App\Config\ScopeConfigInterface');
$methodList = $scope->getValue('payment');
echo '<pre>';
foreach( $methodList as $code => $_method )
{
    //It will print code
    echo '****************************************************';
    echo '<br>';
    echo 'Method Code: '.$code;
    echo '<br>';
    //It will print all payment method information
    print_r($_method);
    echo '<br>';
}
Related Topic