Payment gateways
This page is for website creators who connect a shop to a payment provider. In Exponential a payment gateway is a workflow event on the checkout: when the customer checks out, the event sends them to the provider (or charges directly) and marks the order paid when the provider confirms.
Contents
How payment fits into checkout
settings/paymentgateways.ini [GatewaysSettings] AvailableGateways[]lists the active gateways;GatewaysDirectories[]where their classes are (kernel/shop/paymentgatewaysand extensions).- A workflow with the payment gateway event is connected to the
shop_checkouttrigger (before) (Workflows). - At checkout the event runs. A redirect gateway sends the customer to the provider; the provider calls back the site to confirm; the order gets its paid status.
The kernel's payment classes are documented in doc/eng-us/shop/ (gateway, redirect gateway, payment object, callback
checker, and a PayPal example).
The gateways you can use
| Extension | Provider | Read |
|---|---|---|
ezpaypal | PayPal (redirect, NVP API, notify URL /paypal/notify_url) | ezpaypal |
ezauthorize | Authorize.Net | its own documentation in extension/ezauthorize/ |
Setting up PayPal
From ezpaypal:
- Activate the extension.
- Create
settings/override/paypal.ini.append.phpand set at least[PaypalSettings] Business(your PayPal business account). - Test with PayPal's sandbox server in
[ServerSettings] ServerNamebefore going live. - Add the PayPal workflow event to the checkout workflow.
[OrderSettings] PaymentMadeOrderStatusID(1000) is the status set when the payment is made.
The notify URL must be reachable from the internet and must not require a login.
Testing
- To do: A payment in the provider's test mode completes and the order becomes paid.
- To do: A cancelled payment leaves the order unpaid and the customer can try again.
- To do: The callback works over HTTPS and through any proxy (check the trusted proxies of your setup).
- To do: The Store dashboard no longer says there is no payment step on checkout.
A gateway of your own
A gateway is a class extending the kernel's gateway classes (eZPaymentGateway, or eZRedirectGateway for redirect
providers), registered in paymentgateways.ini of an extension, plus a module view for the provider's callback. The
doc/eng-us/shop/examples/paypal/ pages walk through one. This is application creator work: see
Writing a workflow event type.
Setup > RAD (/setup/handlerextension/paymentgateway, or paymentgatewaydirect for a gateway that takes the
payment without leaving the site) writes the skeleton. Check that the generated class is at
extension/<name>/paymentgateways/<alias>/classes/<alias>gateway.php: the kernel loads
<GatewaysDirectories>/<gateway>/classes/<gateway>gateway.php for each name in AvailableGateways[] and nothing
else. Earlier versions of the tool wrote paymentgateways/<alias>gateway.php, which is never loaded.
Related pages
- Running a shop: overview
- Basket, checkout and orders
- Security for applications
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.