PayPal
Taking PayPal Standard payments: the business e-mail, sandbox testing, how an IPN is verified, the Gateway Log results and what to do when a payment is missing.
The PayPal plugin lets a client pay an invoice with PayPal Standard. The client presses a button on the invoice, pays on PayPal's own page, and PayPal tells AIOBilling about it with an IPN (a payment notice sent from PayPal's server to yours). The payment is then recorded and the invoice is marked paid. It is a free plugin that ships with the script, it takes any currency PayPal can receive, and it suits anyone with a PayPal business account who sells to clients abroad. The shared parts of every gateway (the page, the log, how a payment is recorded) are in Payment gateways.
Switching it on
- Open Setup → Payment Gateways and the tab All Payment Gateways.
- Press Activate on PayPal. The settings page opens at once.
- Fill in the PayPal business e-mail and save.
- Put PayPal in the list order you like with the arrows, or make it the Default Payment Method.
At the bottom of the settings page the Callback URL is shown, for example https://billing.example.com/callback/paypal. You do not need to paste it into PayPal: the address is sent with every payment as the notice address. It is shown so that you can check that your site answers from outside (see Troubleshooting below).
Settings
| Setting | Meaning |
|---|---|
| Display name | What clients see on the checkout and the invoice. Defaults to PayPal. |
| Payment instructions | A text shown under the pay button. |
| Fee % and Fixed fee | A surcharge added to invoices paid with this gateway. 0 means none. The fixed fee is in the invoice currency. |
| Test mode | Use PayPal's sandbox instead of the live PayPal. |
| PayPal business e-mail | The e-mail address of your PayPal business account. Payments are sent to it, and every notice must name it as the receiver. |
| Sandbox business e-mail | Used instead of the one above while Test mode is on: the e-mail of your PayPal sandbox business account. Empty means the live address is used. |
Without a business e-mail the invoice shows PayPal is not set up yet: the business e-mail is missing. instead of the button.
What PayPal needs from you
- A PayPal business account with the e-mail you enter. A personal account is not enough for a shop.
- Nothing else. There are no API keys. The notice address is sent with each payment (
notify_url), so there is no IPN address to register and no IP address to whitelist. - Your site must be reachable from the internet over HTTPS and must not sit behind a login or a password prompt, or PayPal's notice cannot arrive.
- Your server must be able to call PayPal over HTTPS (the PHP
curlextension), because every notice is posted back to PayPal to be checked.
How a payment goes
- The client opens an unpaid invoice and presses Pay ... with PayPal. The amount is the balance still due.
- The browser goes to PayPal with the invoice number, the amount, the currency and the notice address.
- The client pays and returns to the invoice. PayPal also sends the IPN to the callback address.
- The plugin posts the IPN back to PayPal with
cmd=_notify-validate. Only the answer VERIFIED is accepted. - Then it checks that the receiver is your business e-mail, the payment status is Completed and the currency is the invoice's currency.
- A transaction is added with PayPal's transaction ID and the PayPal fee, and the invoice is marked paid. A notice that arrives twice is recorded once.
A notice with another status (Pending, for example) is answered Ignored and logged; the payment is recorded when PayPal sends the Completed notice later. The amount recorded is what PayPal says it received.
Refunds
AIOBilling does not send refunds to PayPal. Refund in PayPal itself, then on the invoice open the Refund tab and choose Offline refund (record only) or Add to the client credit balance. See Invoices and payments.
Testing in the sandbox
- At PayPal's developer site create a sandbox business account and a sandbox personal account.
- In the PayPal settings of AIOBilling switch Test mode on and enter the sandbox business e-mail.
- Create a small unpaid invoice for a test client, sign in to the client area as that client and press Pay ... with PayPal.
- Pay with the sandbox personal account. Back on the invoice the status should turn Paid within a few seconds.
- Switch Test mode off before you go live. The Test Mode column on Setup → Payment Gateways shows On while it is on.
Troubleshooting
Open Billing → Gateway Log, filter by PayPal, and press View on a line to see what PayPal sent. The Result column says what happened:
| Result | Meaning and cure |
|---|---|
paid | Recorded. |
wrong receiver | The notice names another e-mail than the one in the settings. Check the business e-mail, and the sandbox e-mail while testing. |
not verified | PayPal did not answer VERIFIED. Test mode and the PayPal account type must match (sandbox payments need Test mode on). The message may also carry a connection error. |
status ... | The payment is not Completed yet. Wait for the next notice. |
currency mismatch | The payment was made in another currency than the invoice. |
unknown invoice | The notice names an invoice that does not exist here. |
If the log is empty after a payment, PayPal's notice never reached the site: check HTTPS, the firewall, and that nothing blocks the address /callback/paypal. Utilities → Module Log shows the callback call itself with its answer. In Billing → Invoices you can always record the payment by hand with Add Payment. More general fixes are in Troubleshooting.
Was this helpful?
Updated 2026-11-03