hps / heartland-magento2-module

Magento 2 Tokenized Payment Gateway Module
Other
10 stars 10 forks source link

vendor/magento/module-payment/Model/Method/Cc.php deprecated #11

Open ttnnkkrr opened 8 years ago

ttnnkkrr commented 8 years ago

base class deprecated need to update HPS/Heartland/Model/Payment.php

ttnnkkrr commented 8 years ago

So far I have not yet found any recommendations from Magento2 on a replacement

rain2o commented 6 years ago

I see this issue is nearly 2 years old, but I thought I would add some references here to help.

The current way to build a payment gateway in Magento 2 (2.2.5 at the time of writing this) is to implement a series of facade classes in di.xml that simply utilize Magento's Payment module classes allowing you to inject any custom dependencies as needed. The official documentation is here - https://devdocs.magento.com/guides/v2.2/payments-integrations/base-integration/integration-intro.html.

For a sample module see here - https://github.com/magento/magento2-samples/tree/master/sample-module-payment-gateway. It is recommended to start with this and alter to your needs, but since there is already an M2 module for Heartland I'm not sure if it would be less work to refactor it or start over. This would be a major overhaul for this module to implement either way.

I am posting this because I just installed this module to use it and I have been researching M2 payment gateway module development as well. There aren't many articles out there that follow this setup yet from what I can find. I gave this module a look through for implementing the new structure and I'm not sure what the best approach is since it calls out to the heartland-php module for the actual actions (auth, capture, etc...). The new way you would create separate classes for the Request builder, Transfer factory, Client object, and so on. It seems a lot of that will need to be bypassed based on how it is currently working.

Those are my thoughts for now. I can offer my help as time permits if someone pursues refactoring this module.