Closed sIiiS closed 4 years ago
I noticed that. So i looked in the latest magento 2 versions paypal implementation to see the current way of implementing it. https://github.com/magento/magento2/blob/develop/app/code/Magento/Paypal/Model/Express.php#L24 Magento is using this class in their own payment methods, and i havent found the 'right' way yet.
All default payment methods extend this class https://github.com/magento/magento2/blob/develop/app/code/Magento/OfflinePayments/Model/Banktransfer.php#L13 https://github.com/magento/magento2/blob/develop/app/code/Magento/OfflinePayments/Model/Cashondelivery.php#L13 https://github.com/magento/magento2/blob/develop/app/code/Magento/OfflinePayments/Model/Checkmo.php#L13
I don't really understand whats wrong with it, except for being deprecated. Also, if magento hasn't shown another way of doing it, i don't think it will be removed very soon.
Anyway, thanks for the article, i will look into the Magento\Payment\Model\Method\Adapter class
I think Magento will removed them from version 2.2 You can see Braintree payment method, this is latest
See this article https://www.maxpronko.com/blog/devletter-magento-2-0-6-payment-changes