cancel
Showing results for 
Search instead for 
Did you mean: 

Offline Payment Method

Offline Payment Method

Hello,

 

What is a proper way to implement offline payment method in Magento 2.2.*?

I did it old style like in module "magento/module-offline-payments" and it is working.

My payment model extends Magento\Payment\Model\Method\AbstractMethod.

I wonder that Magento\Payment\Model\Method\AbstractMethod is deprecated and suggestion is that custom payment method should extend Magento\Payment\Model\Method\Adapter but I don't want to make integration with any payment provider gateway.

 

In Magento 2 guides I found only integration with third party approach:

https://devdocs.magento.com/guides/v2.2/payments-integrations/bk-payments-integrations.html

Sample:

https://github.com/magento/magento2-samples/tree/master/sample-module-payment-gateway

4 REPLIES

Re: Offline Payment Method

Hello @lordhansolo

 

Please check below blog post to how to create sample payment method without any gateway

 

https://webkul.com/blog/create-custom-payment-method-magento2/

 

Hope you will like this.

 

If works then mark as solution

Re: Offline Payment Method

Hello Sunil,

 

As I mentioned above I created offline payment method but it use Magento\Payment\Model\Method\AbstractMethod. Since Magento\Payment\Model\Method\AbstractMethod is deprecated I would like to know proper way to implement offline payment method. In tutorial that you provided Magento\Payment\Model\Method\AbstractMethod is also used so this is not solution.

 

Sorry I used another email, lordhansolo it's me.

Re: Offline Payment Method

Hello @lordhansolo

 

 

Magento 2 by default using that class

more info you can find:- 

https://github.com/magento/magento2/blob/2.2.4/app/code/Magento/OfflinePayments/Model/Checkmo.php

 

hope it will help you.

Re: Offline Payment Method

Hello Sunil,

 

As I mentioned above I did it like magento but it looks like not proper way since Checkmo also extends deprecated class \Magento\Payment\Model\Method\AbstractMethod.

 

I implemented module and it works but I also used \Magento\Payment\Model\Method\AbstractMethod. It looks like there is not implemented alternate way yet.