Stripe Integration
Connect your Stripe account to Paygent to collect invoice payments through Stripe Checkout. Paygent generates secure payment links, sends them in invoice emails when configured, and automatically marks invoices as paid when Stripe confirms payment.
What Paygent handles for you:
- Creates Stripe Checkout Sessions for unpaid invoices
- Maps Paygent customers to Stripe customers on first payment
- Verifies webhook signatures and records payments when checkout completes
- Stores API keys encrypted — only masked values are shown in the dashboard
Prerequisites
- A Stripe account with API access (test or live mode)
- At least one customer with an email address (required for automated invoice emails)
- An unpaid invoice with a total amount greater than zero
Setup overview
Step 1 — Connect Stripe in Paygent
- Open Settings → Integrations in the Paygent dashboard.
- Toggle Stripe on (or click Edit if already connected).
- Enter a connection name (for example,
Production Stripe). - Paste your Stripe Secret Key — starts with
sk_test_orsk_live_. - Paste your Webhook Signing Secret — starts with
whsec_(you will get this in Step 2). - Click Save Connection.
Where to find your Stripe secret key: In the Stripe Dashboard → Developers → API keys, copy the Secret key. Use test keys while setting up; switch to live keys when you go to production.
Step 2 — Configure the Stripe webhook
Paygent needs Stripe to send a webhook when a customer completes checkout. The webhook URL is unique to your organization and shown in the Connect Stripe dialog after you save your connection.
In the Stripe Dashboard
- Go to Developers → Webhooks and click Add endpoint.
- Paste your Paygent webhook URL (copy it from Settings → Integrations or the connection modal).
- Under Events to send, select:
checkout.session.completed
- Save the endpoint, then open it and reveal the Signing secret (
whsec_...). - Return to Paygent → Settings → Integrations → Edit Stripe and paste the signing secret if you did not have it during initial setup.
Test vs live mode. Webhook endpoints, secret keys, and signing secrets are separate for Stripe test mode and live mode. When you switch from test to live, create a new webhook endpoint in live mode and update both keys in Paygent.
Step 3 — Collect payments on invoices
Once Stripe is connected, you can collect payment in two ways.
Option A — Generate a payment link manually
- Open an unpaid invoice from the Invoices list.
- Click Generate payment link.
- Copy the Stripe Checkout URL and send it to your customer.
- After payment, the customer is redirected to a Paygent confirmation page; the invoice status updates automatically via webhook.
Option B — Include a Stripe link in invoice emails
- Configure email delivery under Settings → Email (SMTP or provider credentials).
- When creating or editing an order, set Invoice email to Send invoice with Stripe payment link.
- When an invoice is generated and emailed, Paygent automatically creates a Checkout Session and embeds the payment link in the email body.
Email requirements:
- Send invoice only — sends the PDF without a payment link
- Send invoice with Stripe payment link — requires Stripe connected and email configured
- The customer record must have a valid email address
How payment flow works
Checkout success and cancel URLs point to public Paygent pages (/pay/success and /pay/cancel). Customers do not need a Paygent login to pay.
Local development with Stripe CLI
For local testing, forward Stripe events to your machine and use the CLI signing secret in Paygent.
Trigger a test payment: Use Stripe test card 4242 4242 4242 4242 with any future expiry and CVC on the Checkout page. See Stripe testing docs for more test cards.
Manual payment recording
If a customer pays outside Stripe Checkout (wire transfer, check, etc.), open the invoice and use Record payment to mark it paid manually. This does not go through Stripe.
Security
Stripe secret keys and webhook secrets are encrypted at rest. The dashboard only displays masked values (last four characters).
The webhook endpoint is public but secured with Stripe signature verification — requests without a valid Stripe-Signature header are rejected.
Troubleshooting
“Generate payment link” button is missing Stripe must be connected under Settings → Integrations, and the invoice must be unpaid.
Invoice email skipped with “stripe_not_connected” Connect Stripe before using “Send invoice with Stripe payment link” on orders.
Customer paid but invoice still shows unpaid
Confirm the webhook endpoint URL matches your organization ID, the signing secret in Paygent matches the endpoint in Stripe, and checkout.session.completed is subscribed. Check webhook delivery logs in the Stripe Dashboard for failed attempts.
“Invalid Stripe signature” in logs The webhook signing secret in Paygent does not match the endpoint in Stripe. Re-copy the secret from Stripe → Webhooks → your endpoint → Signing secret.
You’re ready! After connecting Stripe and configuring the webhook, generate a test payment link from any unpaid invoice and complete a test checkout. The invoice should move to paid within a few seconds.
