0

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.

1 Answer 1

4

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>';
}
4
  • You're a star. Thanks for the fast reply! Dec 11, 2018 at 10:44
  • Welcome always.
    – Aman Alam
    Dec 11, 2018 at 10:45
  • Is there any difference for multi-store?
    – pevik
    Jul 18, 2020 at 20:10
  • OK, there are optional parameters $scopeType and $scopeCode in ScopeConfigInterface.php.
    – pevik
    Aug 2, 2020 at 16:04

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.