Create a new offline payment method in Magento

When it comes to payment methods, it is more common to use an online payment provider (gateway), such as PayPal or Braintree. Sometimes, project requirements may be such that we may need a custom coded payment method. You will need to think of programmatic product import and order creation script that might specialize in some specifically labeled payment method. Thus, the payment process will be controlled by us.

Today, I will share to you that How to create a new offline payment method in magento 2 in a simple example:

1 Create system.xml file in app/code/local/[name_space]/[your_module]/etc/adminhtml
2 create config.xml file in app/code/local/[name_space]/[your_module]/etc
3 create payment.xml file in app/code/local/[name_space]/[your_module]/etc
4 create Newpayment.php in app/code/local/[name_space]/[your_module]/Model
5 create Pendingpayment.php file in
6 create layout: create file checkout_index_index.xml in app/code/local/[name_space]/[your_module]/view/frontend/layout
7 create newpayment.js file in app/code/local/[name_space]/[your_module]/view/frontend/web/js/view/payment
8 create newpayment-method.js in app/code/local/[name_space]/[your_module]/view/frontend/web/js/view/payment/method-renderer
9 create template file newpayment.html in app/code/local/[name_space]/[your_module]/view/frontend/web/template/payment

Step 1:

create system.xml file in app/code/local/[name_space]/[your_module]/etc/adminhtml

Step2:

create config.xml file in app/code/local/[name_space]/[your_module]/etc

Step3:

create payment.xml file in app/code/local/[name_space]/[your_module]/etc

Step4:

create Newpayment.php in app/code/local/[name_space]/[your_module]/Model

Step5:

create Pendingpayment.php file in app/code/local/[name_space]/[your_module]/Model/Config/Source/Order/Status

Step 6:

create layout: create file checkout_index_index.xml in app/code/local/[name_space]/[your_module]/view/frontend/layout

Step 7:

create newpayment.js file in app/code/local/[name_space]/[your_module]/view/frontend/web/js/view/payment

Step 8:

create newpayment-method.js in app/code/local/[name_space]/[your_module]/view/frontend/web/js/view/payment/method-renderer

Step 9:

create template file newpayment.html in app/code/local/[name_space]/[your_module]/view/frontend/web/template/payment

 

 

 

 

 

 

 

     

   

We also contribute great content of Magento Tutorial for Magento 1.x.

DON'T MISS THE CHANCE!

magento tutorial

Magento 2 Authorize.net Setup - Step by Step Tutorial
Add Authorize.net Directpost Payment Method to a Custom Checkout Page in Magento 2

Leave a Reply

Your email address will not be published. Required fields are marked *