I am unable to use Authorize.net or PayPal in the country my store is working. I'm migrating from magento 1.9 to magento 2.1; and I manually process all my payments from credit cards using the Save CC in magento 1.9.
How can I create a custom payment method in magento 2.1 that will allow me to save CC information.
Best Answer
For example, your Payment model, we need to declare the form block
$_formBlockType
.app/code/Vendor/Payment/Model/PaymentMethod.php
We can use the default form or set our new template.
app/code/Vendor/Payment/Block/Form/Cc.php
We should create
app/code/Vendor/Payment/view/frontend/templates/payment/form/cc.phtml
. See more:vendor/magento/module-payment/view/frontend/templates/form/cc.phtml
This is for multi shipping addresses.
For one page checkout page, we need to build the html template and js.
app/code/Vendor/Payment/view/frontend/layout/checkout_index_index.xml
app/code/Vendor/Payment/view/frontend/web/js/view/payment/vendor_payments.js
app/code/Vendor/Paymnet/view/frontend/web/js/view/payment/method-renderer/cc-form.js
app/code/Vendor/Payment/view/frontend/web/template/payment/cc_form.html
We should take a look at Braintree payment module:
vendor/magento/module-braintree