Forums / Developer / Register payment gateway

Register payment gateway

Author Message

Karol Radziuk

Thursday 26 August 2010 4:12:13 am

Hi,

I have problem with my own payment gateway. I've used eZpayplal extension to help. After commenting and disabling almost everything that was in eZpaypal I have this code, which is still working (I can select Paypal gateway called 'Paypal'). I wrote almost the same code, but it doesn't work. (I can't select my gateway called 'DotPay').

This is rest of Paypal code:

define( "EZ_PAYMENT_GATEWAY_TYPE_PAYPAL", "ezpaypal" );

class eZPaypalGateway extends eZRedirectGateway
{
    function eZPaypalGateway()
    {
            $this->logger   = eZPaymentLogger::CreateForAdd( "var/log/ambDotPayType.log" );
            $this->logger->writeTimedString( 'eZPaypalGateway::eZPaypalGateway()' );
    }
}

eZPaymentGatewayType::registerGateway( EZ_PAYMENT_GATEWAY_TYPE_PAYPAL, "ezpaypalgateway", "Paypal" );

And this is my code:

define( "EZ_PAYMENT_GATEWAY_TYPE", "ezdotpay" );

class eZDotPayGateway extends eZRedirectGateway
{
    function eZDotPayGateway()
    {
        $this->logger   = eZPaymentLogger::CreateForAdd( "var/log/eZDotPayGateway.log" );
        $this->logger->writeTimedString( 'eZDotPayGateway::eZDotPayGateway()' );
    }
    
    function execute( $process, $event ) {
        
        return eZWorkflowType::STATUS_ACCEPTED;
    }
    
}

eZPaymentGatewayType::registerGateway( EZ_PAYMENT_GATEWAY_TYPE, "ezdotpaygateway", "DotPay" );

I refresh autoload with the same result:

./bin/php/ezpgenerateautoloads.php -e -p

What is overlooked?

{$me|attribute(show,1)}

Karol Radziuk

Thursday 26 August 2010 6:21:55 am

After several hours of struggling I noticed that the name extension must be the same as the name of the class. It follows that each gateway must be a separate extension.

And even if one file is sufficient:

extension/<my_ext_name>/classes/<my_ext_name>gateway.php

and class must then be of the same name.

So, now question is: Why have entries in workflow.ini.append.php no influence on it?

I mean:

[EventSettings]
ExtensionDirectories[]=<my_ext_name>
AvailableEventTypes[]=event_<my_ext_name>

{$me|attribute(show,1)}

Karol Radziuk

Friday 27 August 2010 5:25:10 am

OK, I found. There is another file to this: paymentgateways.ini

{$me|attribute(show,1)}

Chris Williams

Monday 20 September 2010 1:16:04 am

Hey, seeing that almost a month has passed. How did you get on?

I too am looking at the payment gateway system and so far have concluded that the ezauthroize doesnt work. Which is backed up with the following insight.

http://projects.ez.no/ezauthorize/forum/general/ez4_3_ini_update_errors_incompatible_with_4_3#msg25631

I can see in your code you were just getting it to return a success, but did you manage to get the middle stage of communicating with paypal or creating a form for the user to fill out their details?

Heath

Thursday 21 October 2010 5:28:42 pm

Well Hello Chris,

I'm sorry but as a new eZ Community member you are sadly miss informed.

Any user who would take the time to read the latest svn trunk

for the ezauthorize extension would see that it is indeed

compatible with eZ Publish 4.x (4.1,4.2,4.3,4.4)

eZ Authorize does work, very well in fact. Use the latest version (from svn)!

http://svn.projects.ez.no/ezauthorize/trunk/ezauthorize/

Cheers,

Heath

Brookins Consulting | http://brookinsconsulting.com/
Certified | http://auth.ez.no/certification/verify/380350
Solutions | http://projects.ez.no/users/community/brookins_consulting
eZpedia community documentation project | http://ezpedia.org

Nicolas Pastorino

Monday 25 October 2010 11:11:33 am

Hi Chris,

Putting it in other words, understanding you might not be scanning the SVN repository of all extensions, you should give a try to the trunk Heath pointed to.

Let us know if this gets you up & running again,
Cheers,

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye