4.8 (95.35%) 43 votes

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

Step 2:

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

Step 3:

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

Step 4:

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

Step 5:

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

 

 

 

 

 

 

 

     

   

Your Magento website needs a powerful Magento ERP for stock control.

DON'T MISS THE CHANCE!

magento erp

How to Add Credit Card Form Using Swipe Card Reader in Magento 2 - Magento 2.3
Magento 2 Authorize.net Setup - Magento 2.3

Comments are closed.