{"id":60195,"date":"2016-09-23T13:48:04","date_gmt":"2016-09-23T13:48:04","guid":{"rendered":"http:\/\/webkul.com\/blog\/?p=60195"},"modified":"2026-01-19T06:11:27","modified_gmt":"2026-01-19T06:11:27","slug":"list-active-payment-methods-list-magento2","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/list-active-payment-methods-list-magento2\/","title":{"rendered":"List all Active Payment Methods list Magento 2"},"content":{"rendered":"\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/09\/Magento-Code-Snippet-5-3.png\" alt=\"Magento-Code-Snippet-5-3\" class=\"wp-image-216772\" loading=\"lazy\" \/><\/figure>\n\n\n\n<p>Explore a complete list of active <a href=\"https:\/\/store.webkul.com\/Magento-2\/Payment-Extensions.html\">Magento 2 Payment Methods<\/a> and learn how to enable, manage, and choose the right options for your Magento store.<\/p>\n\n\n\n<p>To get this you can use\u00a0following code:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\n\nnamespace Webkul\\Test\\Model;\n\nuse \\Magento\\Framework\\App\\Config\\ScopeConfigInterface;\nuse \\Magento\\Payment\\Model\\Config;\n\nclass Paymentmethod extends \\Magento\\Framework\\DataObject \n    implements \\Magento\\Framework\\Option\\ArrayInterface\n{\n    \/**\n     * @var ScopeConfigInterface\n     *\/\n    protected $_appConfigScopeConfigInterface;\n    \/**\n     * @var Config\n     *\/\n    protected $_paymentModelConfig;\n    \n    \/**\n     * @param ScopeConfigInterface $appConfigScopeConfigInterface\n     * @param Config               $paymentModelConfig\n     *\/\n    public function __construct(\n        ScopeConfigInterface $appConfigScopeConfigInterface,\n        Config $paymentModelConfig\n    ) {\n\n        $this-&gt;_appConfigScopeConfigInterface = $appConfigScopeConfigInterface;\n        $this-&gt;_paymentModelConfig = $paymentModelConfig;\n    }\n \n    public function toOptionArray()\n    {\n        $payments = $this-&gt;_paymentModelConfig-&gt;getActiveMethods();\n        $methods = array();\n        foreach ($payments as $paymentCode =&gt; $paymentModel) {\n            $paymentTitle = $this-&gt;_appConfigScopeConfigInterface\n                -&gt;getValue(&#039;payment\/&#039;.$paymentCode.&#039;\/title&#039;);\n            $methods&#091;$paymentCode] = array(\n                &#039;label&#039; =&gt; $paymentTitle,\n                &#039;value&#039; =&gt; $paymentCode\n            );\n        }\n        return $methods;\n    }\n}<\/pre>\n\n\n\n<p>Here,<\/p>\n\n\n\n<p>$_appConfigScopeConfigInterface is an object of&nbsp;Magento\\Framework\\App\\Config\\ScopeConfigInterface class.<\/p>\n\n\n\n<p>$_paymentModelConfig is an object of&nbsp;Magento\\Payment\\Model\\Config class.<\/p>\n\n\n\n<p>and in&nbsp;toOptionArray() function we use a method:&nbsp;getActiveMethods() which returns model of all the active methods.<\/p>\n\n\n\n<p>In return array we have all payment methods with their code and title.<\/p>\n\n\n\n<p>I hope this blog will help you with Setup Script files in Magento 2. You may also check our wide range of best&nbsp;<a href=\"https:\/\/store.webkul.com\/Magento-2.html\" target=\"_blank\" rel=\"noreferrer noopener\" data-wpel-link=\"internal\">Magento 2 Extensions<\/a>.<\/p>\n\n\n\n<p>Please reach out to our team via a&nbsp;<a href=\"https:\/\/webkul.uvdesk.com\/en\/customer\/create-ticket\/\" target=\"_blank\" rel=\"noreferrer noopener\" data-wpel-link=\"exclude\">support ticket<\/a>&nbsp;if you have any queries.<\/p>\n\n\n\n<p>Try this and if you have any queries then just comment below \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Explore a complete list of active Magento 2 Payment Methods and learn how to enable, manage, and choose the right options for your Magento store. To get this you can use\u00a0following code: Here, $_appConfigScopeConfigInterface is an object of&nbsp;Magento\\Framework\\App\\Config\\ScopeConfigInterface class. $_paymentModelConfig is an object of&nbsp;Magento\\Payment\\Model\\Config class. and in&nbsp;toOptionArray() function we use a method:&nbsp;getActiveMethods() which returns model <a href=\"https:\/\/webkul.com\/blog\/list-active-payment-methods-list-magento2\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":68,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[302],"tags":[2070],"class_list":["post-60195","post","type-post","status-publish","format-standard","hentry","category-magento2","tag-magento2"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>List all Active Payment Methods list Magento 2<\/title>\n<meta name=\"description\" content=\"Managing Magento 2 Payment Methods correctly improves checkout flow, supports multiple payment options, &amp; enhances overall customer experience.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/list-active-payment-methods-list-magento2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"List all Active Payment Methods list Magento 2\" \/>\n<meta property=\"og:description\" content=\"Managing Magento 2 Payment Methods correctly improves checkout flow, supports multiple payment options, &amp; enhances overall customer experience.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/list-active-payment-methods-list-magento2\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2016-09-23T13:48:04+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-01-19T06:11:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2016\/09\/Magento-Code-Snippet-5-3.png\" \/>\n<meta name=\"author\" content=\"Bulbul\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Bulbul\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/list-active-payment-methods-list-magento2\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/list-active-payment-methods-list-magento2\/\"},\"author\":{\"name\":\"Bulbul\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/c9c6288b3950490ffdb37cb2a526996e\"},\"headline\":\"List all Active Payment Methods list Magento 2\",\"datePublished\":\"2016-09-23T13:48:04+00:00\",\"dateModified\":\"2026-01-19T06:11:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/list-active-payment-methods-list-magento2\/\"},\"wordCount\":149,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/list-active-payment-methods-list-magento2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2016\/09\/Magento-Code-Snippet-5-3.png\",\"keywords\":[\"Magento2\"],\"articleSection\":[\"Magento2\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/list-active-payment-methods-list-magento2\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/list-active-payment-methods-list-magento2\/\",\"url\":\"https:\/\/webkul.com\/blog\/list-active-payment-methods-list-magento2\/\",\"name\":\"List all Active Payment Methods list Magento 2\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/list-active-payment-methods-list-magento2\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/list-active-payment-methods-list-magento2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2016\/09\/Magento-Code-Snippet-5-3.png\",\"datePublished\":\"2016-09-23T13:48:04+00:00\",\"dateModified\":\"2026-01-19T06:11:27+00:00\",\"description\":\"Managing Magento 2 Payment Methods correctly improves checkout flow, supports multiple payment options, & enhances overall customer experience.\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/list-active-payment-methods-list-magento2\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/list-active-payment-methods-list-magento2\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/list-active-payment-methods-list-magento2\/#primaryimage\",\"url\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2016\/09\/Magento-Code-Snippet-5-3.png\",\"contentUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2016\/09\/Magento-Code-Snippet-5-3.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/list-active-payment-methods-list-magento2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"List all Active Payment Methods list Magento 2\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/c9c6288b3950490ffdb37cb2a526996e\",\"name\":\"Bulbul\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/37ea7175f5ae6557d01bb38e147f6a02a540714ecdb71770d8ec554d4d34c23f?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/37ea7175f5ae6557d01bb38e147f6a02a540714ecdb71770d8ec554d4d34c23f?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g\",\"caption\":\"Bulbul\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/bulbul896\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"List all Active Payment Methods list Magento 2","description":"Managing Magento 2 Payment Methods correctly improves checkout flow, supports multiple payment options, & enhances overall customer experience.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/webkul.com\/blog\/list-active-payment-methods-list-magento2\/","og_locale":"en_US","og_type":"article","og_title":"List all Active Payment Methods list Magento 2","og_description":"Managing Magento 2 Payment Methods correctly improves checkout flow, supports multiple payment options, & enhances overall customer experience.","og_url":"https:\/\/webkul.com\/blog\/list-active-payment-methods-list-magento2\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2016-09-23T13:48:04+00:00","article_modified_time":"2026-01-19T06:11:27+00:00","og_image":[{"url":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2016\/09\/Magento-Code-Snippet-5-3.png","type":"","width":"","height":""}],"author":"Bulbul","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Bulbul","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/list-active-payment-methods-list-magento2\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/list-active-payment-methods-list-magento2\/"},"author":{"name":"Bulbul","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/c9c6288b3950490ffdb37cb2a526996e"},"headline":"List all Active Payment Methods list Magento 2","datePublished":"2016-09-23T13:48:04+00:00","dateModified":"2026-01-19T06:11:27+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/list-active-payment-methods-list-magento2\/"},"wordCount":149,"commentCount":2,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/list-active-payment-methods-list-magento2\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2016\/09\/Magento-Code-Snippet-5-3.png","keywords":["Magento2"],"articleSection":["Magento2"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/list-active-payment-methods-list-magento2\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/list-active-payment-methods-list-magento2\/","url":"https:\/\/webkul.com\/blog\/list-active-payment-methods-list-magento2\/","name":"List all Active Payment Methods list Magento 2","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/list-active-payment-methods-list-magento2\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/list-active-payment-methods-list-magento2\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2016\/09\/Magento-Code-Snippet-5-3.png","datePublished":"2016-09-23T13:48:04+00:00","dateModified":"2026-01-19T06:11:27+00:00","description":"Managing Magento 2 Payment Methods correctly improves checkout flow, supports multiple payment options, & enhances overall customer experience.","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/list-active-payment-methods-list-magento2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/list-active-payment-methods-list-magento2\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/list-active-payment-methods-list-magento2\/#primaryimage","url":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2016\/09\/Magento-Code-Snippet-5-3.png","contentUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2016\/09\/Magento-Code-Snippet-5-3.png"},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/list-active-payment-methods-list-magento2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"List all Active Payment Methods list Magento 2"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/c9c6288b3950490ffdb37cb2a526996e","name":"Bulbul","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/37ea7175f5ae6557d01bb38e147f6a02a540714ecdb71770d8ec554d4d34c23f?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/37ea7175f5ae6557d01bb38e147f6a02a540714ecdb71770d8ec554d4d34c23f?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g","caption":"Bulbul"},"url":"https:\/\/webkul.com\/blog\/author\/bulbul896\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/60195","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/68"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=60195"}],"version-history":[{"count":7,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/60195\/revisions"}],"predecessor-version":[{"id":522479,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/60195\/revisions\/522479"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=60195"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=60195"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=60195"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}