Doc needed for develloping payment gateway in 3.9

Author Message

H-Works Agency

Friday 06 April 2007 6:05:37 am

Hi all,

It would be great to have a guide to understand the differences between payment gateway, workflows payment event and the way the gateway has to behave.

What inputs & outputs are needed in the payment gateway to be behave as an action in the workflow and then continue executing the workflow if needed or stop if something went wrong.

This part of ezpublish is really dark. I spent weeks developping a payment gateway but still don't understand really how it works, the way it insert into the workflow process (status accepted, rejected...etc)

I have checker all the payment gateway contributions but they are each based on totally different principle and behavior so its hard to extract a working process out of them.

What is the aim of the paymentgateway.ini ? This file is not even used in the ezpaypal gateway that is include in ezp.

Thanx in advance.

EZP is Great

Heath

Sunday 08 April 2007 11:16:54 am

Hello Martin,

 > It would be great to have a guide to understand the differences between payment gateway, workflows payment event and the way the gateway has to behave.

It's true. It would be nice to have better inline and external code documentation for these components of the kernel.

 > What inputs & outputs are needed in the payment gateway to be behave as an action in the workflow and then continue executing the workflow if needed or stop if something went wrong.

There are several existing example models for creating what can 'do the job' of a payment gateway built into eZ publish and external workflow / payment gateway contributions.

One may even be able to write a deferred to cron payment gateway (workflow event) or a payment gateway url operator, etc, ad-nauseum.

The options are only limited to your understanding of the related kernel systems; shop, workflow, trigger, ezutils, module, eZModuleOperationInfo, eZOperationMemento

There are a large number of details which are less than clear without experience.

 > This part of ezpublish is really dark. I spent weeks developing a payment gateway but still don't understand really how it works, the way it insert into the workflow process (status accepted, rejected...etc)

Congratulations on your success. I think you could reach the deliverables in documentation most quickly by taking a strategic move to contribute your payment gateway on, http://projects.ez.no

With your gateway available for communal code review, discussion and improvement you can more effectively engage other like minded eZ Publish developers. Together the eZ Community offers a large number of potential collaborators. With all the opportunity available in the eZ Community with a little persistence I'm certain you would reach your goals more quickly and directly than otherwise.

 > I have checker all the payment gateway contributions but they are each based on totally different principle and behavior so its hard to extract a working process out of them.

It's true that the history behind payment gateway support is unique. In the beginning payment gateways were first implemented as workflow events (before eZ Publish 3.5). After eZ Publish 3.5 payment gateways could also be implemented as a new base php class separate from the workflow system indirectly supported by the workflow system (which controls workflow event / payment gateway triggers). Most payment gateways in the ez.no contributions and PubSVN are not based on the paymentgateway class and the 3.5 features to flexibly support multiple payment gateways. <i>http://pubsvn.ez.no/websvn/listing.php?repname=nextgen&path=%2Ftrunk%2Fkernel%2Fshop%2Fclasses%2F&rev=7012&sc=1</i>

This major advancement in eZ Publish payment gateway support features was not documented in the public release changelog, <i>http://ez.no/download/ez_publish/changelogs/ez_publish_3_5</i>

It was noted in the actual full changelog, 'Added new interface for building payment gateways.' <i>http://pubsvn.ez.no/nextgen/trunk/doc/changelogs/3.5/CHANGELOG-3.4.4-to-3.5.0</i>

To-date eZ Authorize and eZ Paypal are the only available payment gateways (no-redirect/curl vs redirect gateway classes) which use the multiple payment gateway support. Paynet solution is rumored to also be derived of the 3.5 payment gateway support; though it's not yet free software available for public review.

 > What is the aim of the paymentgateway.ini ? This file is not even used in the ezpaypal gateway that is include in ezp.

Here is the contents of the settings/paymentgateways.ini

#?ini charset="iso-8859-1"?

[GatewaysSettings]
AvailableGateways[]

GatewaysDirectories[]
GatewaysDirectories[]=kernel/shop/paymentgateways

You can see that the block 'GatewaySettings' contains the 'AvailableGateways' array which is empty by default. The 'AvailableGateways' array is similar in style as 'AvailableEventTypes' setting array. You can see that the 'GatewaysDirectories' is similar in style as 'ExtensionDirectories' setting which is often used to hold a directory path to use to autoload php code. You can see that the 'GatewaysDirectories' is similar in style as 'ExtensionDirectories' setting which is often used to hold a directory path to use to autoload php code.

Martin you can get the most from the eZ Community when you share your information. When we all share together we can accomplish tasks which alone might appear daunting. One could easily write an article on the composition of your contributed payment gateway which might answer some of your more complicated or detailed questions.

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

Monday 09 April 2007 3:37:30 am

There is also the always reliable but not always detailed. <i>http://ezpedia.org/wiki/en/ez/doxygen</i>

I found: <i>http://pubsvn.ez.no/doxygen/classeZPaymentGatewayType.html
http://pubsvn.ez.no/doxygen/classeZPaymentLogger.html</i>

So the doxygen is omitting a bit more files than are really available from the subversion trunk,

Class: eZPaymentGatewayType extends eZWorkflowEventType
<i>http://pubsvn.ez.no/nextgen/trunk/kernel/classes/workflowtypes/event/ezpaymentgateway/ezpaymentgatewaytype.php</i>

Class: eZPaymentGatewayType extends eZWorkflowEventType
<i>http://pubsvn.ez.no/nextgen/trunk/kernel/classes/workflowtypes/event/ezpaymentgateway/ezpaymentgatewaytype.php</i>

Class: eZPaymentObject extends eZPersistentObject
<i>http://pubsvn.ez.no/nextgen/trunk/kernel/shop/classes/ezpaymentobject.php</i>

Class: eZRedirectGateway extends eZPaymentGateway
<i>http://pubsvn.ez.no/nextgen/trunk/kernel/shop/classes/ezredirectgateway.php</i>

Class: eZPaymentGateway
<i>http://pubsvn.ez.no/nextgen/trunk/kernel/shop/classes/ezpaymentgateway.php</i>

Class: eZPaymentLogger
<i>http://pubsvn.ez.no/nextgen/trunk/kernel/classes/workflowtypes/event/ezpaymentgateway/ezpaymentlogger.php</i>

Class: eZPaymentCallbackChecker
<i>http://pubsvn.ez.no/nextgen/trunk/kernel/shop/classes/ezpaymentcallbackchecker.php</i>

Placeholder example payment gateway class directory (A remnant from before extensions were the popular method for distribution of payment gateways) <i>http://pubsvn.ez.no/nextgen/trunk/kernel/shop/paymentgateways/</i>

Module: Shop (Checkout)
<i>http://pubsvn.ez.no/nextgen/trunk/kernel/shop/checkout.php
http://pubsvn.ez.no/nextgen/trunk/kernel/shop/operation_definition.php</i>

Class: eZTrigger extends eZPersistentObject
<i>http://pubsvn.ez.no/nextgen/trunk/kernel/classes/eztrigger.php</i>

Class: eZWorkflow extends eZPersistentObject
<i>http://pubsvn.ez.no/nextgen/trunk/kernel/classes/ezworkflow.php</i>

Class: eZWorkflowEvent extends eZPersistentObject
<i>http://pubsvn.ez.no/nextgen/trunk/kernel/classes/ezworkflowevent.php</i>

Class: eZWorkflowGroup extends eZPersistentObject
<i>http://pubsvn.ez.no/nextgen/trunk/kernel/classes/ezworkflowgroup.php</i>

Class: eZWorkflowGroupLink extends eZPersistentObject
<i>http://pubsvn.ez.no/nextgen/trunk/kernel/classes/ezworkflowgrouplink.php</i>

Class: eZWorkflowProcess extends eZPersistentObject
<i>http://pubsvn.ez.no/nextgen/trunk/kernel/classes/ezworkflowprocess.php</i>

Class: eZWorkflowType
<i>http://pubsvn.ez.no/nextgen/trunk/kernel/classes/ezworkflowtype.php</i>

Stock Workflow Types
<i>http://pubsvn.ez.no/nextgen/trunk/kernel/classes/workflowtypes/event/</i>

Heath

Monday 09 April 2007 3:45:25 am

There is also a rich history of relevant past forum conversations; which show a slow migration from creating workflow events used for payment gateways as a solution methodology. Evolving to using a new separate class to provide for a flexible solution to support multiple payment gateway needs of various forms of different requirements.

Allowing you to choose how you support your payment gateways api via http-redirect, curl request, soap service, executable command, etc. While still allowing for multiple payment gateways to coexist within a single workflow.

<i>http://ez.no/content/advancedsearch?SearchText=payment+gateway&PhraseSearchText=&SearchContentClassID=-1&SearchContentClassAttributeID=-1&SearchSectionID=-1&SubTreeArray%5B%5D=308&SearchDate=-1&SearchPageLimit=5</i>

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

H-Works Agency

Thursday 12 April 2007 4:43:43 am

Hello Heath,

Thanx a lot for all those informations. I am shure it's as much a help for the community as it is for me.

I am gonna publish my gateway in projets.ez.no as soon as i made some small changes to it.

Martin

EZP is Great

Heath

Saturday 14 April 2007 10:11:40 pm

Hello Martin,

Your welcome. I hope this helps expose some the the provided for use cases within eZ Publish source code.

I might take another moment to point out that there were some further documentation which was removed from the the eZ publish subversion, yet never relocated into the ez.no/docs. Here is a copy of these documents.

There are some old documents only found in one revision of the eZ publish trunk in the following subversion history,
<i>http://pubsvn.ez.no/websvn/listing.php?repname=nextgen&path=%2Ftrunk%2Fkernel%2Fshop%2Fclasses%2F&rev=7012&sc=1</i>

The payment gateway documentation within the kernel in svn revision #7012
<i>http://download.ezcommunity.net/ezpublish_payment_gateway_documentation_removed_from_trunk/kernel__shop/classes/doc/</i>

A related forum thread ...
<i>http://ez.no/community/forum/developer/ezcrew_request_on_guidelines_for_development_future_payment_gateway_adoptions</i>

I really do look forward to reviewing your payment gateway extension on projects.ez.no!

hth,

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

kracker (the)

Sunday 15 April 2007 1:31:18 am

Hello Martin!

It is good to see you again in the forums tackling some of the more interesting subjects within eZ. We (the eZ Publish community) really could use further examples of different forms of eZ Publish payment gateway extensions.

Just recently the addition of the 'eCard' payment gateway shows all the users of eZ Publish a proven solution to adapting an existing url redirection payment gateway based on the stock eZ Paypal payment gateway.

<i>http://ez.no/community/contribs/workflow/ecard_payment_gateway</i>

Now that this source code is freely publicly available all users can more quickly build a payment gateway based on eZ Paypal using both examples as a reference or guide.

I welcome your contribution as well as it may be the very snippet of code that allows another users reaching for this often critical development deliverable to achieve the understanding of the subject matter needed to create their own unique payment gateway extension for eZ Publish.

//kracker

<b>Sole : mansbestfriend : Hard to Burn</b>

Member since: 2001.07.13 || http://ezpedia.se7enx.com/

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.