Hi
I am trying to override Magento Payment Helper data in my extension to restirct payment method but its not working.
I have override by using preference method.
Here is the below code I have put below code in app/code/Demo/PaymentTest/etc/di.xml
<preference for="Magento\Payment\Helper\Data" type="Demo\PaymentTest\Helper\Data" />
Here is My Helper code
<?php namespace Demo\PaymentTest\Helper; class Data extends \Magento\Payment\Helper\Data { public function getStoreMethods($store = null, $quote = null) { } }
I am trying to override getStoreMethods method in my helper but its not calling it.
Can you please tell me where i am doing wrong?
Thanks in advnace.
Hi @Sanjay Jethva,
This isn't a solution but why not using Plugins? http://devdocs.magento.com/guides/v2.1/extension-dev-guide/plugins.html
It will be a better approach to handle a modification to core modules.
Hello @Damian Culotta,
Thanks for your answer. I have tried plugins but file is calling but method is not calling.
Please share a code.
Thanks in advnace.