{"id":106144,"date":"2017-12-26T09:49:25","date_gmt":"2017-12-26T09:49:25","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=106144"},"modified":"2024-07-09T10:56:11","modified_gmt":"2024-07-09T10:56:11","slug":"add-cc-form-custom-payment-method-magento2","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/add-cc-form-custom-payment-method-magento2\/","title":{"rendered":"How to add cc form in custom payment method in magento2"},"content":{"rendered":"\n<p>Here, I am explaining that how to add cc form in custom payment method in magento2. For this you have to read this block <a href=\"https:\/\/webkul.com\/blog\/create-custom-payment-method-magento2\/\" target=\"_blank\" rel=\"noopener\">Create custom payment method in magento2<\/a>. In this block explain how to create&nbsp; custom payment method.<\/p>\n\n\n\n<p>After creating custom payment method you have to add following file for adding cc form in payment method.<\/p>\n\n\n\n<p>1 &#8211; Update\u00a0app\/code\/Test\/Testpayment\/view\/frontend\/web\/template\/payment\/testpayment.html In this file call cc form 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;payment-method-billing-address&quot;&gt;\n            &lt;!-- ko foreach: $parent.getRegion(getBillingAddressFormName()) --&gt;\n            &lt;!-- ko template: getTemplate() --&gt;&lt;!-- \/ko --&gt;\n            &lt;!--\/ko--&gt;\n        &lt;\/div&gt;\n        &lt;form class=&quot;form&quot; id=&quot;pay&quot; action=&quot;#&quot; name=&quot;pay&quot; method=&quot;post&quot; &gt;\n            &lt;!-- ko template: &#039;Test_Testpayment\/payment\/testpayment-form&#039; --&gt;&lt;!-- \/ko --&gt;\n        &lt;\/form&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>2 &#8211; add app\/code\/Test\/Testpayment\/view\/frontend\/web\/template\/payment\/testpayment-form.html . In this file create cc form.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;fieldset data-bind=&quot;attr: {class: &#039;fieldset payment items ccard &#039; + getCode(), id: &#039;payment_form_&#039; + getCode()}&quot;&gt;\n    &lt;legend class=&quot;legend&quot;&gt;\n        &lt;span&gt;&lt;!-- ko i18n: &#039;Credit Card Information&#039;--&gt;&lt;!-- \/ko --&gt;&lt;\/span&gt;\n    &lt;\/legend&gt;&lt;br \/&gt;\n    &lt;div class=&quot;field type&quot;&gt;\n        &lt;div class=&quot;control&quot;&gt;\n            &lt;ul class=&quot;credit-card-types&quot;&gt;\n                &lt;!-- ko foreach: {data: getCcAvailableTypesValues(), as: &#039;item&#039;} --&gt;\n                &lt;li class=&quot;item&quot; data-bind=&quot;css: {\n                                                 _active: $parent.selectedCardType() == item.value,\n                                                 _inactive: $parent.selectedCardType() != null &amp;&amp; $parent.selectedCardType() != item.value\n                                                 } &quot;&gt;\n                &lt;\/li&gt;\n                &lt;!--\/ko--&gt;\n            &lt;\/ul&gt;\n            &lt;input type=&quot;hidden&quot;\n                   name=&quot;payment&#091;cc_type]&quot;\n                   class=&quot;input-text&quot;\n                   value=&quot;&quot;\n                   data-bind=&quot;attr: {id: getCode() + &#039;_cc_type&#039;, &#039;data-container&#039;: getCode() + &#039;-cc-type&#039;},\n                   value: creditCardType\n                   &quot;&gt;\n        &lt;\/div&gt;\n    &lt;\/div&gt;\n    &lt;div class=&quot;field number required&quot;&gt;\n        &lt;label data-bind=&quot;attr: {for: getCode() + &#039;_cc_number&#039;}&quot; class=&quot;label&quot;&gt;\n            &lt;span&gt;&lt;!-- ko i18n: &#039;Credit Card Number&#039;--&gt;&lt;!-- \/ko --&gt;&lt;\/span&gt;\n        &lt;\/label&gt;\n        &lt;div class=&quot;control&quot;&gt;\n            &lt;input type=&quot;number&quot; name=&quot;payment&#091;cc_number]&quot; class=&quot;input-text&quot; value=&quot;&quot;\n                   data-bind=&quot;attr: {\n                                    autocomplete: off,\n                                    id: getCode() + &#039;_cc_number&#039;,\n                                    title: $t(&#039;Credit Card Number&#039;),\n                                    &#039;data-container&#039;: getCode() + &#039;-cc-number&#039;,\n                                    &#039;data-validate&#039;: JSON.stringify({&#039;required-number&#039;:true, &#039;validate-card-type&#039;:getCcAvailableTypesValues(), &#039;validate-card-number&#039;:&#039;#&#039; + getCode() + &#039;_cc_type&#039;, &#039;validate-cc-type&#039;:&#039;#&#039; + getCode() + &#039;_cc_type&#039;})},\n                              enable: isActive($parents),\n                              value: creditCardNumber,\n                              valueUpdate: &#039;keyup&#039; &quot;\/&gt;\n        &lt;\/div&gt;\n    &lt;\/div&gt;\n    &lt;div class=&quot;field date required&quot; data-bind=&quot;attr: {id: getCode() + &#039;_cc_type_exp_div&#039;}&quot;&gt;\n        &lt;label data-bind=&quot;attr: {for: getCode() + &#039;_expiration&#039;}&quot; class=&quot;label&quot;&gt;\n            &lt;span&gt;&lt;!-- ko i18n: &#039;Expiration Date&#039;--&gt;&lt;!-- \/ko --&gt;&lt;\/span&gt;\n        &lt;\/label&gt;\n        &lt;div class=&quot;control&quot;&gt;\n            &lt;div class=&quot;fields group group-2&quot;&gt;\n                &lt;div class=&quot;field no-label month&quot;&gt;\n                    &lt;div class=&quot;control&quot;&gt;\n                        &lt;select  name=&quot;payment&#091;cc_exp_month]&quot;\n                                 class=&quot;select select-month&quot;\n                                 data-bind=&quot;attr: {id: getCode() + &#039;_expiration&#039;, &#039;data-container&#039;: getCode() + &#039;-cc-month&#039;, &#039;data-validate&#039;: JSON.stringify({required:true, &#039;validate-cc-exp&#039;:&#039;#&#039; + getCode() + &#039;_expiration_yr&#039;})},\n                                            enable: isActive($parents),\n                                            options: getCcMonthsValues(),\n                                            optionsValue: &#039;value&#039;,\n                                            optionsText: &#039;month&#039;,\n                                            optionsCaption: $t(&#039;Month&#039;),\n                                            value: creditCardExpMonth&quot;&gt;\n                        &lt;\/select&gt;\n                    &lt;\/div&gt;\n                &lt;\/div&gt;\n                &lt;div class=&quot;field no-label year&quot;&gt;\n                    &lt;div class=&quot;control&quot;&gt;\n                        &lt;select name=&quot;payment&#091;cc_exp_year]&quot;\n                                class=&quot;select select-year&quot;\n                                data-bind=&quot;attr: {id: getCode() + &#039;_expiration_yr&#039;, &#039;data-container&#039;: getCode() + &#039;-cc-year&#039;, &#039;data-validate&#039;: JSON.stringify({required:true})},\n                                           enable: isActive($parents),\n                                           options: getCcYearsValues(),\n                                           optionsValue: &#039;value&#039;,\n                                           optionsText: &#039;year&#039;,\n                                           optionsCaption: $t(&#039;Year&#039;),\n                                           value: creditCardExpYear&quot;&gt;\n                        &lt;\/select&gt;\n                    &lt;\/div&gt;\n                &lt;\/div&gt;\n            &lt;\/div&gt;\n        &lt;\/div&gt;\n    &lt;\/div&gt;\n    &lt;!-- ko if: (hasVerification())--&gt;\n    &lt;div class=&quot;field cvv required&quot; data-bind=&quot;attr: {id: getCode() + &#039;_cc_type_cvv_div&#039;}&quot;&gt;\n        &lt;label data-bind=&quot;attr: {for: getCode() + &#039;_cc_cid&#039;}&quot; class=&quot;label&quot;&gt;\n            &lt;span&gt;&lt;!-- ko i18n: &#039;Card Verification Number&#039;--&gt;&lt;!-- \/ko --&gt;&lt;\/span&gt;\n        &lt;\/label&gt;\n        &lt;div class=&quot;control _with-tooltip&quot;&gt;\n            &lt;input type=&quot;number&quot;\n                   autocomplete=&quot;off&quot;\n                   class=&quot;input-text cvv&quot;\n                   name=&quot;payment&#091;cc_cid]&quot;\n                   value=&quot;&quot;\n                   data-bind=&quot;attr: {id: getCode() + &#039;_cc_cid&#039;,\n                        title: $t(&#039;Card Verification Number&#039;),\n                        &#039;data-container&#039;: getCode() + &#039;-cc-cvv&#039;,\n                        &#039;data-validate&#039;: JSON.stringify({&#039;required-number&#039;:true, &#039;validate-card-cvv&#039;:&#039;#&#039; + getCode() + &#039;_cc_type&#039;})},\n                        enable: isActive($parents),\n                        value: creditCardVerificationNumber&quot; \/&gt;\n            &lt;div class=&quot;field-tooltip toggle&quot;&gt;\n                &lt;span class=&quot;field-tooltip-action action-cvv&quot;\n                      tabindex=&quot;0&quot;\n                      data-toggle=&quot;dropdown&quot;\n                      data-bind=&quot;attr: {title: $t(&#039;What is this?&#039;)}, mageInit: {&#039;dropdown&#039;:{&#039;activeClass&#039;: &#039;_active&#039;}}&quot;&gt;\n                    &lt;span&gt;&lt;!-- ko i18n: &#039;What is this?&#039;--&gt;&lt;!-- \/ko --&gt;&lt;\/span&gt;\n                &lt;\/span&gt;\n            &lt;\/div&gt;\n        &lt;\/div&gt;\n    &lt;\/div&gt;\n    &lt;!-- \/ko --&gt;\n&lt;\/fieldset&gt;<\/pre>\n\n\n\n<p>3 &#8211; Update\u00a0app\/code\/Test\/Testpayment\/view\/frontend\/web\/js\/view\/payment\/method-renderer\/testpayment.js add some method related cc form.Which file using to get data from config provider.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">define(\n    &#091;\n        &#039;underscore&#039;,\n        &#039;Magento_Checkout\/js\/view\/payment\/default&#039;,\n        &#039;Magento_Payment\/js\/model\/credit-card-validation\/credit-card-data&#039;,\n        &#039;Magento_Payment\/js\/model\/credit-card-validation\/credit-card-number-validator&#039;,\n        &#039;mage\/translate&#039;\n    ],\n    function (_, Component, creditCardData, cardNumberValidator, $t) {\n        &#039;use strict&#039;;\n\n        return Component.extend({\n            defaults: {\n                template: &#039;Test_Testpayment\/payment\/testpayment&#039;,\n                creditCardType: &#039;&#039;,\n                creditCardExpYear: &#039;&#039;,\n                creditCardExpMonth: &#039;&#039;,\n                creditCardNumber: &#039;&#039;,\n                creditCardSsStartMonth: &#039;&#039;,\n                creditCardSsStartYear: &#039;&#039;,\n                creditCardVerificationNumber: &#039;&#039;,\n                selectedCardType: null\n            },\n            initObservable: function () {\n                this._super()\n                    .observe(&#091;\n                        &#039;creditCardType&#039;,\n                        &#039;creditCardExpYear&#039;,\n                        &#039;creditCardExpMonth&#039;,\n                        &#039;creditCardNumber&#039;,\n                        &#039;creditCardVerificationNumber&#039;,\n                        &#039;creditCardSsStartMonth&#039;,\n                        &#039;creditCardSsStartYear&#039;,\n                        &#039;selectedCardType&#039;\n                    ]);\n                return this;\n            },\n\n            initialize: function() {\n                var self = this;\n                this._super();\n\n                \/\/Set credit card number to credit card data object\n                this.creditCardNumber.subscribe(function(value) {\n                    var result;\n                    self.selectedCardType(null);\n\n                    if (value == &#039;&#039; || value == null) {\n                        return false;\n                    }\n                    result = cardNumberValidator(value);\n\n                    if (!result.isPotentiallyValid &amp;&amp; !result.isValid) {\n                        return false;\n                    }\n                    if (result.card !== null) {\n                        self.selectedCardType(result.card.type);\n                        creditCardData.creditCard = result.card;\n                    }\n\n                    if (result.isValid) {\n                        creditCardData.creditCardNumber = value;\n                        self.creditCardType(result.card.type);\n                    }\n                });\n\n                \/\/Set expiration year to credit card data object\n                this.creditCardExpYear.subscribe(function(value) {\n                    creditCardData.expirationYear = value;\n                });\n\n                \/\/Set expiration month to credit card data object\n                this.creditCardExpMonth.subscribe(function(value) {\n                    creditCardData.expirationYear = value;\n                });\n\n                \/\/Set cvv code to credit card data object\n                this.creditCardVerificationNumber.subscribe(function(value) {\n                    creditCardData.cvvCode = value;\n                });\n            },\n\n            isActive: function () {\n                return true;\n            },\n\n            getCcAvailableTypes: function() {\n                return window.checkoutConfig.payment.testpayment.availableTypes&#091;&#039;testpayment&#039;];\n            },\n\n            getCcMonths: function() {\n                return window.checkoutConfig.payment.testpayment.months&#091;&#039;testpayment&#039;];\n            },\n\n            getCcYears: function() {\n                return window.checkoutConfig.payment.testpayment.years&#091;&#039;testpayment&#039;];\n            },\n\n            hasVerification: function() {\n                return window.checkoutConfig.payment.testpayment.hasVerification&#091;&#039;testpayment&#039;];\n            },\n\n            getCcAvailableTypesValues: function() {\n                return _.map(this.getCcAvailableTypes(), function(value, key) {\n                    return {\n                        &#039;value&#039;: key,\n                        &#039;type&#039;: value\n                    }\n                });\n            },\n            getCcMonthsValues: function() {\n                return _.map(this.getCcMonths(), function(value, key) {\n                    return {\n                        &#039;value&#039;: key,\n                        &#039;month&#039;: value\n                    }\n                });\n            },\n            getCcYearsValues: function() {\n                return _.map(this.getCcYears(), function(value, key) {\n                    return {\n                        &#039;value&#039;: key,\n                        &#039;year&#039;: value\n                    }\n                });\n            }\n        });\n    }\n);<\/pre>\n\n\n\n<p>4 &#8211; Add\u00a0app\/code\/Test\/Testpayment\/etc\/frontend\/di.xml.Using this map with config provider.<\/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:ObjectManager\/etc\/config.xsd&quot;&gt;\n    &lt;type name=&quot;Magento\\Checkout\\Model\\CompositeConfigProvider&quot;&gt;\n        &lt;arguments&gt;\n            &lt;argument name=&quot;configProviders&quot; xsi:type=&quot;array&quot;&gt;\n                &lt;item name=&quot;test_testpayment_configprovider&quot; xsi:type=&quot;object&quot;&gt;Test\\Testpayment\\Model\\TestpaymentConfigProvider&lt;\/item&gt;\n            &lt;\/argument&gt;\n        &lt;\/arguments&gt;\n    &lt;\/type&gt;\n&lt;\/config&gt;<\/pre>\n\n\n\n<p>5 &#8211; Add\u00a0app\/code\/Test\/Testpayment\/Model\/TestpaymentConfigProvider.php.Using getConfig method set data for checkout config.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\n\nnamespace Test\\Testpayment\\Model;\n\nuse Magento\\Checkout\\Model\\ConfigProviderInterface;\nuse Magento\\Framework\\View\\Asset\\Source;\n\nclass TestpaymentConfigProvider implements ConfigProviderInterface\n{\n    \/**\n    * @param CcConfig $ccConfig\n    * @param Source $assetSource\n    *\/\n    public function __construct(\n        public \\Magento\\Payment\\Model\\CcConfig $ccConfig,\n        public Source $assetSource\n    ) {\n        $this-&gt;ccConfig = $ccConfig;\n        $this-&gt;assetSource = $assetSource;\n    }\n\n    \/**\n    * @var string&#091;]\n    *\/\n    protected $_methodCode = &#039;testpayment&#039;;\n\n    \/**\n    * {@inheritdoc}\n    *\/\n    public function getConfig()\n    {\n        return &#091;\n            &#039;payment&#039; =&gt; &#091;\n                &#039;testpayment&#039; =&gt; &#091;\n                    &#039;availableTypes&#039; =&gt; &#091;$this-&gt;_methodCode =&gt; $this-&gt;ccConfig-&gt;getCcAvailableTypes()],\n                    &#039;months&#039; =&gt; &#091;$this-&gt;_methodCode =&gt; $this-&gt;ccConfig-&gt;getCcMonths()],\n                    &#039;years&#039; =&gt; &#091;$this-&gt;_methodCode =&gt; $this-&gt;ccConfig-&gt;getCcYears()],\n                    &#039;hasVerification&#039; =&gt; $this-&gt;ccConfig-&gt;hasVerification(),\n                ]\n            ]\n        ];\n    }\n}<\/pre>\n\n\n\n<p>After adding above file.flush cache and check checkout page.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"1276\" height=\"650\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/12\/Screenshot_85.png\" alt=\"cc form in custom payment method\" class=\"wp-image-106148\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/12\/Screenshot_85.png 1276w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/12\/Screenshot_85-250x127.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/12\/Screenshot_85-300x153.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/12\/Screenshot_85-768x391.png 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/12\/Screenshot_85-1200x611.png 1200w\" sizes=\"(max-width: 1276px) 100vw, 1276px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<p>Using above approach we can add cc form in custom payment method.<br>I hope this blog will help you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here, I am explaining that how to add cc form in custom payment method in magento2. For this you have to read this block Create custom payment method in magento2. In this block explain how to create&nbsp; custom payment method. After creating custom payment method you have to add following file for adding cc form <a href=\"https:\/\/webkul.com\/blog\/add-cc-form-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":[5966,3656,2070],"class_list":["post-106144","post","type-post","status-publish","format-standard","hentry","category-magento2","tag-add-cc-form-in-magento-2","tag-custom-payment-method","tag-magento2"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>add cc form custom payment method magento2<\/title>\n<meta name=\"description\" content=\"add cc form custom payment method in magento2.Using this you can create custom payment method in magento2.\" \/>\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\/add-cc-form-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=\"add cc form custom payment method magento2\" \/>\n<meta property=\"og:description\" content=\"add cc form custom payment method in magento2.Using this you can create custom payment method in magento2.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/add-cc-form-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=\"2017-12-26T09:49:25+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-07-09T10:56:11+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2017\/12\/Screenshot_85.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=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/add-cc-form-custom-payment-method-magento2\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/add-cc-form-custom-payment-method-magento2\/\"},\"author\":{\"name\":\"Shubham Sharma\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/ae41bc19a6783d2f09c6b9b3a0fbddfd\"},\"headline\":\"How to add cc form in custom payment method in magento2\",\"datePublished\":\"2017-12-26T09:49:25+00:00\",\"dateModified\":\"2024-07-09T10:56:11+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/add-cc-form-custom-payment-method-magento2\/\"},\"wordCount\":201,\"commentCount\":3,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/add-cc-form-custom-payment-method-magento2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2017\/12\/Screenshot_85.png\",\"keywords\":[\"add cc form in magento 2\",\"custom payment method\",\"Magento2\"],\"articleSection\":[\"Magento2\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/add-cc-form-custom-payment-method-magento2\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/add-cc-form-custom-payment-method-magento2\/\",\"url\":\"https:\/\/webkul.com\/blog\/add-cc-form-custom-payment-method-magento2\/\",\"name\":\"add cc form custom payment method magento2\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/add-cc-form-custom-payment-method-magento2\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/add-cc-form-custom-payment-method-magento2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2017\/12\/Screenshot_85.png\",\"datePublished\":\"2017-12-26T09:49:25+00:00\",\"dateModified\":\"2024-07-09T10:56:11+00:00\",\"description\":\"add cc form custom payment method in magento2.Using this you can create custom payment method in magento2.\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/add-cc-form-custom-payment-method-magento2\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/add-cc-form-custom-payment-method-magento2\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/add-cc-form-custom-payment-method-magento2\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/12\/Screenshot_85.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/12\/Screenshot_85.png\",\"width\":1276,\"height\":650},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/add-cc-form-custom-payment-method-magento2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to add cc form in custom payment method in magento2\"}]},{\"@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":"add cc form custom payment method magento2","description":"add cc form custom payment method in magento2.Using this you can create custom payment method in magento2.","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\/add-cc-form-custom-payment-method-magento2\/","og_locale":"en_US","og_type":"article","og_title":"add cc form custom payment method magento2","og_description":"add cc form custom payment method in magento2.Using this you can create custom payment method in magento2.","og_url":"https:\/\/webkul.com\/blog\/add-cc-form-custom-payment-method-magento2\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2017-12-26T09:49:25+00:00","article_modified_time":"2024-07-09T10:56:11+00:00","og_image":[{"url":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2017\/12\/Screenshot_85.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":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/add-cc-form-custom-payment-method-magento2\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/add-cc-form-custom-payment-method-magento2\/"},"author":{"name":"Shubham Sharma","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/ae41bc19a6783d2f09c6b9b3a0fbddfd"},"headline":"How to add cc form in custom payment method in magento2","datePublished":"2017-12-26T09:49:25+00:00","dateModified":"2024-07-09T10:56:11+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/add-cc-form-custom-payment-method-magento2\/"},"wordCount":201,"commentCount":3,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/add-cc-form-custom-payment-method-magento2\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2017\/12\/Screenshot_85.png","keywords":["add cc form in magento 2","custom payment method","Magento2"],"articleSection":["Magento2"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/add-cc-form-custom-payment-method-magento2\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/add-cc-form-custom-payment-method-magento2\/","url":"https:\/\/webkul.com\/blog\/add-cc-form-custom-payment-method-magento2\/","name":"add cc form custom payment method magento2","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/add-cc-form-custom-payment-method-magento2\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/add-cc-form-custom-payment-method-magento2\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2017\/12\/Screenshot_85.png","datePublished":"2017-12-26T09:49:25+00:00","dateModified":"2024-07-09T10:56:11+00:00","description":"add cc form custom payment method in magento2.Using this you can create custom payment method in magento2.","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/add-cc-form-custom-payment-method-magento2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/add-cc-form-custom-payment-method-magento2\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/add-cc-form-custom-payment-method-magento2\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/12\/Screenshot_85.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/12\/Screenshot_85.png","width":1276,"height":650},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/add-cc-form-custom-payment-method-magento2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to add cc form in custom payment method in magento2"}]},{"@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\/106144","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=106144"}],"version-history":[{"count":6,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/106144\/revisions"}],"predecessor-version":[{"id":452073,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/106144\/revisions\/452073"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=106144"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=106144"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=106144"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}