Stripe
Stripe Checkout payments: the live and test keys, the webhook and its signing secret, refunds from the invoice, test cards and common errors.
The Stripe plugin takes payments through Stripe Checkout, a payment page hosted by Stripe. The client presses a button on the invoice, is sent to Stripe, pays there, and comes back to the invoice. Which cards, wallets and local payment methods appear on that page is decided by your Stripe account, not by AIOBilling. The plugin is free, takes the invoice's currency (including currencies without cents, such as JPY), and can send refunds to Stripe from the invoice. It is a good first choice for clients abroad. See Payment gateways for what all gateways share.
Switching it on
- Open Setup → Payment Gateways, tab All Payment Gateways, and press Activate on Stripe.
- On the settings page enter the keys (below) and save.
- In Stripe add the webhook with the Webhook URL shown on the same page.
- Test with Stripe's test keys first.
Settings
| Setting | Meaning |
|---|---|
| Display name, Payment instructions, Fee %, Fixed fee | The settings every gateway has: the name clients see, a text under the button, and a surcharge. |
| Test mode | Use the test keys below instead of the live ones. |
| Live secret key | Starts with sk_live_. In the Stripe dashboard: Developers > API keys. |
| Live webhook signing secret | Starts with whsec_. Shown by Stripe after you add the webhook. |
| Test secret key | Starts with sk_test_. Used while Test mode is on. |
| Test webhook signing secret | The whsec_ secret of the webhook you made in Stripe's test mode. |
| Webhook URL | Read only: your callback address, such as https://billing.example.com/callback/stripe. Copy it into Stripe. |
The four secrets are password fields: they show empty with (unchanged), and an empty box keeps the saved value. The keys are grouped on the page under Live keys, Test keys and Webhook.
What Stripe needs from you
- A Stripe account that is allowed to take payments in your currency.
- The secret key (not the publishable key; this plugin does not use it).
- A webhook endpoint in Developers > Webhooks: paste the Webhook URL and select the event
checkout.session.completed. The plugin also acceptscheckout.session.async_payment_succeededfor payment methods that finish later. Copy the signing secret that Stripe shows into the matching field here. Make one endpoint in live mode and one in test mode, each with its own secret. - No IP address needs to be whitelisted.
- HTTPS on your site and the PHP
curlextension. The server clock must be right: a webhook older than five minutes is refused.
How a payment goes
- The client presses Pay ... by card on an unpaid invoice of their own. AIOBilling creates a Checkout Session for the balance due, with the invoice number as the product name, and sends the client to Stripe.
- The client pays on Stripe. Stripe sends the browser back to the invoice and sends the signed webhook to your callback address.
- Both ways end in the same check: the session must be paid, and its currency must be the invoice's currency. The amount recorded is what Stripe charged.
- A transaction is added (its ID is Stripe's payment intent), the Stripe fee is read from Stripe and saved with it, and the invoice is marked paid. If the browser and the webhook both arrive, the payment is recorded once.
The webhook is the safety net for a client who closes the tab before coming back, so do not skip it.
Refunds
On the invoice open the Refund tab, choose the transaction, give the amount (all or part) and under Refund to choose Refund through the payment gateway. The plugin asks Stripe for the refund and records it when Stripe accepts. If Stripe refuses, the message says why (for example, more than was captured). See Invoices and payments.
Testing
- Enter the Test secret key and make a test-mode webhook; enter its secret as Test webhook signing secret.
- Switch Test mode on.
- Pay a small invoice with the test card number
4242 4242 4242 4242, any future date and any CVC. - The invoice should turn Paid, and in Stripe's test dashboard the webhook shows a 200 answer.
- Switch Test mode off and make sure the live keys and the live webhook secret are filled in.
Troubleshooting
Look at Billing → Gateway Log (filter Stripe) and Utilities → Module Log.
| Message or result | Cure |
|---|---|
| Stripe is not set up yet: the secret key is missing. | Fill the key for the mode you are in (live or test). |
| Stripe could not start the payment: ... | Stripe's own words follow: a wrong key, a currency your account cannot take, or an amount below Stripe's minimum. |
bad signature / The webhook signature is not valid. | The signing secret is wrong or empty, belongs to the other mode, or the server clock is more than five minutes off. |
currency mismatch | The session was paid in another currency than the invoice. |
| The Stripe session could not be checked. | The secret key is wrong or the server could not reach Stripe. |
| Nothing is due on this invoice. | The invoice is already paid in full. |
If a client paid but the invoice stays unpaid and the log has no line at all, the webhook is not reaching you; check the endpoint in Stripe's dashboard for failed deliveries. You can always record the payment by hand with Add Payment. More in Troubleshooting.
Was this helpful?
Updated 2026-11-03