Extend Omnipay

Questions around the TYPO3 integration and plugins
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Kaloa
Posts: 6
Joined: 13 Feb 2017, 12:55

Extend Omnipay

Post by Kaloa » 23 Feb 2017, 14:46

Hello,

I'm doing my integration service payment test. I do not have Compose on my current server.
I found https://github.com/ck-developer/omnipay-payline to have a Payline gateway for Omnipay.

As this one is not integrated in Aimeos_pay extension, I think that create a new Typo3 extension is the best way.
Because otherwise an update of the extension "Aimeos_pay" will delete my library.

So I have :
A Typo3 extension with my Payline class :
/typo3conf/ext/kaloa_aimeos_payline/Resources/Private/Extensions/kaloa_aimeos_payline/lib/custom/src/MShop/Service/Provider/Payment/Payline.php

Code: Select all

namespace Aimeos\MShop\Service\Provider\Payment;
class Payline
    extends \Aimeos\MShop\Service\Provider\Payment\OmniPay
	implements \Aimeos\MShop\Service\Provider\Payment\Iface
{
	/**
	 * Returns the prefix for the configuration definitions
	 *
	 * @return string Prefix without dot
	 */
	protected function getConfigPrefix()
	{
		return 'Payline';
	}
    /**
	 * Returns the value for the given configuration key
	 *
	 * @param string $key Configuration key name
	 * @param mixed $default Default value if no configuration is found
	 * @return mixed Configuration value
	 */
	protected function getValue( $key, $default = null )
	{
		switch( $key )
		{
			case 'type': return 'Payline\Web';
			case 'onsite': return false;
		}
		return parent::getValue( $key, $default );
	}
}
In the backend, I configure my new payment Service with provider value to "Payline".
It's Ok... The class is found and I move on to the "Resume" step.
I click on the "Buy" button and there I get the error "Class '\Omnipay\Payline\WebGateway' not found".
Logic, Omnipay does not know this.

I try to simply create a Libraries directory in the Private folder "/typo3conf/ext/kaloa_aimeos_payline/Resources/Libraries/ck-developer/omnipay-payline" in which I filed the folder "ck-developer" but after ... ???

How to declare this new library to Omnipay ?
Thank you

By the way, I've change : 'aimeos' => '16.3.0-16.99.99', to 'aimeos' => '16.3.0-17.99.99' to be compatible in aimeos_pay/ext_emconf.php

Kaloa
Posts: 6
Joined: 13 Feb 2017, 12:55

Re: Extend Omnipay

Post by Kaloa » 23 Feb 2017, 17:46

I reply to myself:

In ext_localconf.php of the extension foreach file:

Code: Select all

Require_once \ TYPO3 \ CMS \ Core \ Utility \ ExtensionManagementUtility :: extPath ($ _EXTKEY). '/Resources/Libraries/ck-developer/omnipay-payline/src/AbstractGateway.php';

Post Reply