PayPal payments
This page is for business owners who want customers to pay with PayPal. It explains, from the business side, what the
ezpaypal extension does, what it checks before an order counts as paid, which settings you decide, and how to test
before going live. The setup reference is ezpaypal.
Contents
- Why PayPal
- How a PayPal payment works
- What the extension checks
- What you decide
- Order status after payment
- Testing in the sandbox
- When something goes wrong
- Version and license
Why PayPal
For a small business, a redirect provider such as PayPal has two practical benefits:
- Card details never pass through your site. The customer pays on PayPal's page, so your server does not handle card numbers (Card payments and PCI basics).
- It ships with Exponential.
se7enxweb/ezpaypalis required by the rootcomposer.json(~1.2.3), so it is installed with the system and only needs to be activated and configured.
How a PayPal payment works
From ezpaypal and the extension's code
(extension/ezpaypal/classes/ezpaypalgateway.php):
- The customer confirms the order and checks out.
- The PayPal workflow event on the checkout sends the customer to PayPal, with your business account, a short order description, the order number, the amount and the currency.
- The customer pays on PayPal's page.
- PayPal sends a notification to your site's notify address,
/paypal/notify_url. - The extension checks the notification (next section) and, if all is well, approves the payment and sets the order's status.
Warning
The notify address must be reachable from the internet and must not require a login (Payment gateways). A site behind HTTP basic authentication, an IP allow list or maintenance mode will take payments that never get marked as paid.
What the extension checks
Before marking an order paid, the notify view (extension/ezpaypal/modules/paypal/notify_url.php) and the kernel's
callback checker (kernel/shop/classes/ezpaymentcallbackchecker.php) check that:
- PayPal confirms the notification is genuine (the checker posts it back to PayPal for validation);
- the payment status is Completed;
- the amount matches the order total including VAT;
- the currency matches the order's currency.
If any check fails, the order is not marked paid and the reason is written to the extension's log. This protects you against forged notifications and against payments of the wrong amount.
What you decide
All settings go in settings/override/paypal.ini.append.php, never in the shipped file
(ezpaypal):
| Setting | Decide |
|---|---|
[PaypalSettings] Business | Your PayPal business account; required |
[ServerSettings] ServerName | PayPal's sandbox for testing, the live server (shipped https://www.paypal.com) for real payments |
[PaypalSettings] MaxDescriptionLength | How long the order description on PayPal may be (shipped 127) |
NoNote, NoteLabel, PageStyle, BackgroundColor, LogoURI | How PayPal's page looks to your customer: your logo, a note field |
[OrderSettings] PaymentMadeOrderStatusID | The order status set when payment is made (shipped 1000) |
Order status after payment
The shipped value of PaymentMadeOrderStatusID is 1000, which is the first number for custom statuses; the
seventeen shipped statuses use 1 to 17 (Orders and order statuses).
Before going live, decide one of these:
- point it at the shipped Paid status, 5, so the dashboard and the status path work with the standard statuses; or
- create a custom status with the number 1000 (for example "Paid with PayPal") and include it in your process.
Then place a test payment and check that the order shows the status you chose.
Testing in the sandbox
- To do:
ServerNamepoints at PayPal's sandbox server, with a sandbox business account inBusiness. - To do: A test payment completes and the order gets the paid status.
- To do: A canceled payment leaves the order unpaid, and the customer can return to the basket.
- To do: The notify address is reached over HTTPS from outside (no login, no IP block).
- To do: An order in a second currency is accepted by PayPal and matched on return.
- To do:
ServerNameandBusinessare switched to live values on launch day, and one small real payment is made and refunded.
PayPal's own account types, fees and integration rules are set by PayPal; check with them that your account supports this kind of redirect payment and notification before you build on it.
When something goes wrong
| Symptom | First thing to check |
|---|---|
| Customer paid, order not marked paid | Is the notify address reachable without login? Does the log show a failed check? |
| "Amount does not match" in the log | Rounding or a currency mismatch (Prices and currencies) |
| Customers land on the sandbox after launch | ServerName still points at the sandbox |
| Status is set but not shown in your process | PaymentMadeOrderStatusID points at a status you do not use |
For errors on the site in general, see When something goes wrong.
Version and license
The Exponential releases of ezpaypal (1.2.0 to 1.2.3) are GPL v2 or later; the extension's own README still describes its original dual licensing, and payment behavior is unchanged in these releases (ezpaypal).
Related pages
- ezpaypal
- Payment gateways for businesses
- Card payments and PCI basics
- 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.