Page 1 of 1

Overiding or extending Omnipay

Posted: 14 Aug 2017, 18:31
by bill
Hi

I have ai-payment installed in my ext , my question :
is there away to add a function in : ext/ai-payments/lib/custom/src/MShop/Service/Provider/Payment/OmniPay.php without changing the ai-payments core?

please let me know

Thanks

Re: Overiding or extending Omnipay

Posted: 15 Aug 2017, 08:49
by aimeos
Yes, extend form the OmniPay class and give your class a new name. Save it in your own extension in the same directory structure. Use the name of your own class in the service tab instead of "OmniPay".

Re: Overiding or extending Omnipay

Posted: 15 Aug 2017, 15:26
by bill
Hi

You mean the service tab in the admin? I used AuthorizeAIM not Omnipay , but from what I foudn out that Omnipay is the one used for ALL ai-payment payments gateways

So I need to create a new class lets say I call it "NewOmniPay.php" and save it here :
ext/My-EXT/lib/custom/src/MShop/Service/Provider/Payment/NewOmniPay.php

is that Correct?

Do I need to add this path to the shop.php config?

Re: Overiding or extending Omnipay

Posted: 15 Aug 2017, 20:29
by aimeos
If you use AuthorizeAIM, you should extend from this class and name it NewAuthorizeAIM or alike.
What changes do you want to make? Are they interesting for others too?

No, you don't need more configuration because the path "lib/custom/src" is already in the manifest.php of your project specific extension and you use it by configuring "NewAuthorizeAIM" instead of "OmniPay".