{"id":59813,"date":"2016-09-21T07:22:26","date_gmt":"2016-09-21T07:22:26","guid":{"rendered":"http:\/\/webkul.com\/blog\/?p=59813"},"modified":"2024-12-20T10:37:13","modified_gmt":"2024-12-20T10:37:13","slug":"create-custom-payment-method-magento2","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/create-custom-payment-method-magento2\/","title":{"rendered":"How to Create Custom Payment Method in Magento 2"},"content":{"rendered":"\n<p>In this dev doc article, we will learn how to create <a href=\"https:\/\/store.webkul.com\/Magento-2\/Payment-Extensions.html\" target=\"_blank\" rel=\"noreferrer noopener\">Magento 2 Payment Method<\/a> Development and render it to the checkout page in Magento 2.<\/p>\n\n\n\n<p>There are following files will have to create:-<\/p>\n\n\n\n<p>1 &#8211; Create&nbsp;Test\/Testpayment\/registration.php for register your module.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\n\\Magento\\Framework\\Component\\ComponentRegistrar::register(\n    \\Magento\\Framework\\Component\\ComponentRegistrar::MODULE,\n    &#039;Test_Testpayment&#039;,\n    __DIR__\n);<\/pre>\n\n\n\n<p>2- Create Test\/Testpayment\/etc\/module.xml for define module name.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?xml version=&quot;1.0&quot;?&gt;\n&lt;config xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; xsi:noNamespaceSchemaLocation=&quot;urn:magento:framework:Module\/etc\/module.xsd&quot;&gt;\n    &lt;module name=&quot;Test_Testpayment&quot; setup_version=&quot;2.0.0&quot; active=&quot;true&quot;&gt;\n    &lt;\/module&gt;\n&lt;\/config&gt;<\/pre>\n\n\n\n<p>3- Create&nbsp;Test\/Testpayment\/etc\/config.xml for define your payment method.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?xml version=&quot;1.0&quot;?&gt;\n&lt;config xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; xsi:noNamespaceSchemaLocation=&quot;..\/..\/Store\/etc\/config.xsd&quot;&gt;\n    &lt;default&gt;\n        &lt;payment&gt;\n            &lt;testpayment&gt;\n                &lt;payment_action&gt;authorize&lt;\/payment_action&gt;&lt;!-- You can use another methor like capture  --&gt;\n                &lt;model&gt;Test\\Testpayment\\Model\\PaymentMethod&lt;\/model&gt;\n                &lt;active&gt;1&lt;\/active&gt;\n                &lt;title&gt;Test Payment&lt;\/title&gt;\n                &lt;order_status&gt;pending_payment&lt;\/order_status&gt;&lt;!-- set default order status--&gt;\n            &lt;\/testpayment&gt;\n        &lt;\/payment&gt;\n    &lt;\/default&gt;\n&lt;\/config&gt;<\/pre>\n\n\n\n<p>4- Create&nbsp;Test\/Testpayment\/etc\/adminhtml\/system.xml for display payment method in backend. In this file mentioned only one field for enable\/disable method.You can add field accordingly your need.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?xml version=&quot;1.0&quot;?&gt;\n&lt;config xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; xsi:noNamespaceSchemaLocation=&quot;urn:magento:module:Magento_Config:etc\/system_file.xsd&quot;&gt;\n    &lt;system&gt;\n        &lt;section id=&quot;payment&quot;&gt;\n                &lt;group id=&quot;testpayment&quot; translate=&quot;label&quot; sortOrder=&quot;2&quot; showInDefault=&quot;1&quot; showInWebsite=&quot;1&quot; showInStore=&quot;1&quot;&gt;\n                    &lt;label&gt;Test Payment&lt;\/label&gt;\n                    &lt;field id=&quot;active&quot; translate=&quot;label comment&quot; sortOrder=&quot;1&quot; type=&quot;select&quot; showInDefault=&quot;1&quot; showInWebsite=&quot;1&quot; showInStore=&quot;0&quot;&gt;\n                        &lt;label&gt;Enable&lt;\/label&gt;\n                        &lt;source_model&gt;Magento\\Config\\Model\\Config\\Source\\Yesno&lt;\/source_model&gt;\n                    &lt;\/field&gt;\n                &lt;\/group&gt;\n        &lt;\/section&gt;\n    &lt;\/system&gt;\n&lt;\/config&gt;<\/pre>\n\n\n\n<p>5- Create model file to define payment method&nbsp;Test\/Testpayment\/Model\/PaymentMethod.php<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\n\nnamespace Test\\Testpayment\\Model;\n\n\/**\n * Pay In Store payment method model\n *\/\nclass PaymentMethod extends \\Magento\\Payment\\Model\\Method\\AbstractMethod\n{\n    \/**\n     * Payment code\n     *\n     * @var string\n     *\/\n    protected $_code = 'testpayment';\n\n    \/**\n     * Authorizes specified amount.\n     *\n     * @param InfoInterface $payment\n     * @param float         $amount\n     *\n     * @return $this\n     *\n     * @throws LocalizedException\n     *\/\n    public function authorize( \\Magento\\Payment\\Model\\InfoInterface $payment, $amount ) \n    {\n        return $this;\n    }\n}<\/pre>\n\n\n\n<p>6- In this file&nbsp;Test\/Testpayment\/view\/frontend\/web\/js\/view\/payment\/method-renderer.js register our template or renderer file.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">define(\n    &#091;\n        &#039;uiComponent&#039;,\n        &#039;Magento_Checkout\/js\/model\/payment\/renderer-list&#039;\n    ],\n    function (\n        Component,\n        rendererList\n    ) {\n        &#039;use strict&#039;;\n        rendererList.push(\n            {\n                type: &#039;testpayment&#039;,\n                component: &#039;Test_Testpayment\/js\/view\/payment\/method-renderer\/testpayment&#039;\n            }\n        );\n        return Component.extend({});\n    }\n);<\/pre>\n\n\n\n<p>7- Create&nbsp;Test\/Testpayment\/view\/frontend\/web\/js\/view\/payment\/method-renderer\/testpayment.js<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">define(\n    &#091;\n        &#039;Magento_Checkout\/js\/view\/payment\/default&#039;\n    ],\n    function (Component) {\n        &#039;use strict&#039;;\n\n        return Component.extend({\n            defaults: {\n                template: &#039;Test_Testpayment\/payment\/testpayment&#039;\n            }\n        });\n    }\n);<\/pre>\n\n\n\n<p>8- Create template file Test\/Testpayment\/view\/frontend\/web\/template\/payment\/testpayment.html<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;div class=&quot;payment-method&quot; data-bind=&quot;css: {&#039;_active&#039;: (getCode() == isChecked())}&quot;&gt;\n    &lt;div class=&quot;payment-method-title field choice&quot;&gt;\n        &lt;input type=&quot;radio&quot;\n               name=&quot;payment&#091;method]&quot;\n               class=&quot;radio&quot;\n               data-bind=&quot;attr: {&#039;id&#039;: getCode()}, value: getCode(), checked: isChecked, click: selectPaymentMethod, visible: isRadioButtonVisible()&quot;\/&gt;\n        &lt;label data-bind=&quot;attr: {&#039;for&#039;: getCode()}&quot; class=&quot;label&quot;&gt;&lt;span data-bind=&quot;text: getTitle()&quot;&gt;&lt;\/span&gt;&lt;\/label&gt;\n    &lt;\/div&gt;\n    &lt;div class=&quot;payment-method-content&quot;&gt;\n        &lt;div class=&quot;actions-toolbar&quot;&gt;\n            &lt;div class=&quot;primary&quot;&gt;\n                &lt;button class=&quot;action primary checkout&quot;\n                        type=&quot;submit&quot;\n                        data-bind=&quot;\n                        click: placeOrder,\n                        attr: {title: $t(&#039;Place Order&#039;)},\n                        css: {disabled: !isPlaceOrderActionAllowed()},\n                        enable: (getCode() == isChecked())\n                        &quot;\n                        disabled&gt;\n                    &lt;span data-bind=&quot;i18n: &#039;Place Order&#039;&quot;&gt;&lt;\/span&gt;\n                &lt;\/button&gt;\n            &lt;\/div&gt;\n        &lt;\/div&gt;\n    &lt;\/div&gt;\n&lt;\/div&gt;<\/pre>\n\n\n\n<p>9- Create Test\/Testpayment\/view\/frontend\/layout\/checkout_index_index.xml for define payment method at checkout page.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?xml version=&quot;1.0&quot;?&gt;\n&lt;page xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; xsi:noNamespaceSchemaLocation=&quot;urn:magento:framework:View\/Layout\/etc\/page_configuration.xsd&quot;&gt;\n    &lt;body&gt;\n        &lt;referenceBlock name=&quot;checkout.root&quot;&gt;\n            &lt;arguments&gt;\n                &lt;argument name=&quot;jsLayout&quot; xsi:type=&quot;array&quot;&gt;\n                    &lt;item name=&quot;components&quot; xsi:type=&quot;array&quot;&gt;\n                        &lt;item name=&quot;checkout&quot; xsi:type=&quot;array&quot;&gt;\n                            &lt;item name=&quot;children&quot; xsi:type=&quot;array&quot;&gt;\n                                &lt;item name=&quot;steps&quot; xsi:type=&quot;array&quot;&gt;\n                                    &lt;item name=&quot;children&quot; xsi:type=&quot;array&quot;&gt;\n                                        &lt;item name=&quot;billing-step&quot; xsi:type=&quot;array&quot;&gt;\n                                            &lt;item name=&quot;component&quot; xsi:type=&quot;string&quot;&gt;uiComponent&lt;\/item&gt;\n                                            &lt;item name=&quot;children&quot; xsi:type=&quot;array&quot;&gt;\n                                                &lt;item name=&quot;payment&quot; xsi:type=&quot;array&quot;&gt;\n                                                    &lt;item name=&quot;children&quot; xsi:type=&quot;array&quot;&gt;\n                                                        &lt;item name=&quot;renders&quot; xsi:type=&quot;array&quot;&gt;\n                                                            &lt;!-- merge payment method renders here --&gt;\n                                                            &lt;item name=&quot;children&quot; xsi:type=&quot;array&quot;&gt;\n                                                                &lt;item name=&quot;testpayment&quot; xsi:type=&quot;array&quot;&gt;\n                                                                    &lt;item name=&quot;component&quot; xsi:type=&quot;string&quot;&gt;Test_Testpayment\/js\/view\/payment\/method-renderer&lt;\/item&gt;\n                                                                    &lt;item name=&quot;methods&quot; xsi:type=&quot;array&quot;&gt;\n                                                                        &lt;item name=&quot;testpayment&quot; xsi:type=&quot;array&quot;&gt;\n                                                                            &lt;item name=&quot;isBillingAddressRequired&quot; xsi:type=&quot;boolean&quot;&gt;true&lt;\/item&gt;\n                                                                        &lt;\/item&gt;\n                                                                    &lt;\/item&gt;\n                                                                &lt;\/item&gt;\n                                                            &lt;\/item&gt;\n                                                        &lt;\/item&gt;\n                                                    &lt;\/item&gt;\n                                                &lt;\/item&gt;\n                                            &lt;\/item&gt;\n                                        &lt;\/item&gt;\n                                    &lt;\/item&gt;\n                                &lt;\/item&gt;\n                            &lt;\/item&gt;\n                        &lt;\/item&gt;\n                    &lt;\/item&gt;\n                &lt;\/argument&gt;\n            &lt;\/arguments&gt;\n        &lt;\/referenceBlock&gt;\n    &lt;\/body&gt;\n&lt;\/page&gt;<\/pre>\n\n\n\n<p>Now to install this module execute php bin\/magento setup:upgrade command in your root.<\/p>\n\n\n\n<p>Now, You can check your custom payment method at checkout page like as below screen-shot.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"849\" height=\"528\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/09\/a735a0b50e33489491284754800a8122.png\" alt=\"create custom payment method magento 2\" class=\"wp-image-59824\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/09\/a735a0b50e33489491284754800a8122.png 849w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/09\/a735a0b50e33489491284754800a8122-250x155.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/09\/a735a0b50e33489491284754800a8122-300x187.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/09\/a735a0b50e33489491284754800a8122-768x478.png 768w\" sizes=\"(max-width: 849px) 100vw, 849px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<p>Thank&#8217;s for reading this article on Magento 2 payment method. <\/p>\n\n\n\n<p>Now you will be able to develop customized payment options, from the basic Cash On Delivery method to a more complex and unique, <a href=\"https:\/\/store.webkul.com\/magento2-partial-payment-emi.html\" target=\"_blank\" rel=\"noopener\">Magento 2 Partial Payment extension<\/a>.<\/p>\n\n\n\n<p>We hope you have learned something new today. If you have any queries please send us an email at <a href=\"mailto:support@webkul.com\">support@webkul.com<\/a>.  You may also check our quality <a href=\"https:\/\/store.webkul.com\/Magento-2.html\" target=\"_blank\" rel=\"noreferrer noopener\">Magento 2 Extensions<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this dev doc article, we will learn how to create Magento 2 Payment Method Development and render it to the checkout page in Magento 2. There are following files will have to create:- 1 &#8211; Create&nbsp;Test\/Testpayment\/registration.php for register your module. 2- Create Test\/Testpayment\/etc\/module.xml for define module name. 3- Create&nbsp;Test\/Testpayment\/etc\/config.xml for define your payment method. <a href=\"https:\/\/webkul.com\/blog\/create-custom-payment-method-magento2\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":115,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[302],"tags":[3656,3655,3657],"class_list":["post-59813","post","type-post","status-publish","format-standard","hentry","category-magento2","tag-custom-payment-method","tag-how-to-create-custom-payment-method-in-magento2","tag-render-payment-method-at-checkout"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Create Custom Payment Method in Magento 2<\/title>\n<meta name=\"description\" content=\"In this dev doc, you will learn how to create a custom payment method in Magento 2 and test it at the checkout page.\" \/>\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\/create-custom-payment-method-magento2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Create Custom Payment Method in Magento 2\" \/>\n<meta property=\"og:description\" content=\"In this dev doc, you will learn how to create a custom payment method in Magento 2 and test it at the checkout page.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/create-custom-payment-method-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-21T07:22:26+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-12-20T10:37:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2016\/09\/a735a0b50e33489491284754800a8122.png\" \/>\n<meta name=\"author\" content=\"Shubham Sharma\" \/>\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=\"Shubham Sharma\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/create-custom-payment-method-magento2\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/create-custom-payment-method-magento2\/\"},\"author\":{\"name\":\"Shubham Sharma\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/ae41bc19a6783d2f09c6b9b3a0fbddfd\"},\"headline\":\"How to Create Custom Payment Method in Magento 2\",\"datePublished\":\"2016-09-21T07:22:26+00:00\",\"dateModified\":\"2024-12-20T10:37:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/create-custom-payment-method-magento2\/\"},\"wordCount\":285,\"commentCount\":26,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/create-custom-payment-method-magento2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2016\/09\/a735a0b50e33489491284754800a8122.png\",\"keywords\":[\"custom payment method\",\"How to create custom payment method in Magento2\",\"Render payment method at checkout\"],\"articleSection\":[\"Magento2\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/create-custom-payment-method-magento2\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/create-custom-payment-method-magento2\/\",\"url\":\"https:\/\/webkul.com\/blog\/create-custom-payment-method-magento2\/\",\"name\":\"How to Create Custom Payment Method in Magento 2\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/create-custom-payment-method-magento2\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/create-custom-payment-method-magento2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2016\/09\/a735a0b50e33489491284754800a8122.png\",\"datePublished\":\"2016-09-21T07:22:26+00:00\",\"dateModified\":\"2024-12-20T10:37:13+00:00\",\"description\":\"In this dev doc, you will learn how to create a custom payment method in Magento 2 and test it at the checkout page.\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/create-custom-payment-method-magento2\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/create-custom-payment-method-magento2\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/create-custom-payment-method-magento2\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/09\/a735a0b50e33489491284754800a8122.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/09\/a735a0b50e33489491284754800a8122.png\",\"width\":849,\"height\":528},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/create-custom-payment-method-magento2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Create Custom Payment Method in 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\/ae41bc19a6783d2f09c6b9b3a0fbddfd\",\"name\":\"Shubham Sharma\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/cdf13545eee5ced4cecd7bd6cb94c1d842ec000d359f91dd900e0feec6242c3b?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/cdf13545eee5ced4cecd7bd6cb94c1d842ec000d359f91dd900e0feec6242c3b?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Shubham Sharma\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/shubham-sharma967\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Create Custom Payment Method in Magento 2","description":"In this dev doc, you will learn how to create a custom payment method in Magento 2 and test it at the checkout page.","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\/create-custom-payment-method-magento2\/","og_locale":"en_US","og_type":"article","og_title":"How to Create Custom Payment Method in Magento 2","og_description":"In this dev doc, you will learn how to create a custom payment method in Magento 2 and test it at the checkout page.","og_url":"https:\/\/webkul.com\/blog\/create-custom-payment-method-magento2\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2016-09-21T07:22:26+00:00","article_modified_time":"2024-12-20T10:37:13+00:00","og_image":[{"url":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2016\/09\/a735a0b50e33489491284754800a8122.png","type":"","width":"","height":""}],"author":"Shubham Sharma","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Shubham Sharma","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/create-custom-payment-method-magento2\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/create-custom-payment-method-magento2\/"},"author":{"name":"Shubham Sharma","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/ae41bc19a6783d2f09c6b9b3a0fbddfd"},"headline":"How to Create Custom Payment Method in Magento 2","datePublished":"2016-09-21T07:22:26+00:00","dateModified":"2024-12-20T10:37:13+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/create-custom-payment-method-magento2\/"},"wordCount":285,"commentCount":26,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/create-custom-payment-method-magento2\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2016\/09\/a735a0b50e33489491284754800a8122.png","keywords":["custom payment method","How to create custom payment method in Magento2","Render payment method at checkout"],"articleSection":["Magento2"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/create-custom-payment-method-magento2\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/create-custom-payment-method-magento2\/","url":"https:\/\/webkul.com\/blog\/create-custom-payment-method-magento2\/","name":"How to Create Custom Payment Method in Magento 2","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/create-custom-payment-method-magento2\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/create-custom-payment-method-magento2\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2016\/09\/a735a0b50e33489491284754800a8122.png","datePublished":"2016-09-21T07:22:26+00:00","dateModified":"2024-12-20T10:37:13+00:00","description":"In this dev doc, you will learn how to create a custom payment method in Magento 2 and test it at the checkout page.","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/create-custom-payment-method-magento2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/create-custom-payment-method-magento2\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/create-custom-payment-method-magento2\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/09\/a735a0b50e33489491284754800a8122.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/09\/a735a0b50e33489491284754800a8122.png","width":849,"height":528},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/create-custom-payment-method-magento2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Create Custom Payment Method in 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\/ae41bc19a6783d2f09c6b9b3a0fbddfd","name":"Shubham Sharma","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/cdf13545eee5ced4cecd7bd6cb94c1d842ec000d359f91dd900e0feec6242c3b?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cdf13545eee5ced4cecd7bd6cb94c1d842ec000d359f91dd900e0feec6242c3b?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Shubham Sharma"},"url":"https:\/\/webkul.com\/blog\/author\/shubham-sharma967\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/59813","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\/115"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=59813"}],"version-history":[{"count":18,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/59813\/revisions"}],"predecessor-version":[{"id":477738,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/59813\/revisions\/477738"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=59813"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=59813"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=59813"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}