Caution: This documentation is for eZ Publish legacy, from version 3.x to 6.x.
For 5.x documentation covering Platform see eZ Documentation Center, for difference between legacy and Platform see 5.x Architecture overview.

Payment gateway

Summary

Generic solution for handling payment redirections.

Description

This event is a general solution that is capable of handling different kinds of payment redirections. It allows several payment gateway mechanisms to be plugged into the system through a workflow. The workflow must be assigned to the "shop/checkout/before" trigger. The following screenshot shows the edit interface for this event.

Edit interface for the "Payment gateway" event.

Edit interface for the "Payment gateway" event.

Type

The "Type" menu shows the payment gateway solutions that are available (installed and activated) as eZ publish extensions. It allows the administrator to select which payment gateway(s) that should be used. If several gateways are selected, the system will allow the customer to choose between the available gateways during the checkout process. The selection interface is presented using "/templates/workflow/selectgateway.tpl" located in the current or one of the fallback designs.

Execution

The following list shows the flow of execution when a payment gateway is used through the interface that this workflow event provides.

  1. The customer initiates the checkout process.
  2. The browser is redirected to the target payment server (PayPal, PayNet, etc.).
  3. The customer attempts to pay for the products using the payment gateway.
  4. The browser is sent back to eZ publish, the order will be either approved or rejected.

Between steps 3 and 4, the selected payment server will notify eZ publish about the purchase.
The system will validate the authenticity (identity) of the message, and based on the reply it will either approve or reject the order. In case of no reply, the validation process will time-out and the customer will be asked to contact the shop owner.

This event provides a development framework which simplifies the implementation of payment solutions.

Balazs Halasy (25/04/2005 1:44 pm)

Balazs Halasy (28/04/2005 2:30 pm)


Comments

  • Creating a payment gateway extension

    If you are confused by how payment gateway extensions are recognized by the payment gateway event (as I was), all you need to do is create a PHP file named extension/[extension_name]/classes/[extension_name]gateway.php and it will automatically be added to the list when editing a payment gateway event.

    There's no need to edit or override paymentgateways.ini.append.php

    Check out the ezpaypal extension for ideas on how the payment class is constructed.