Connect Stripe
Stripe takes the card payments for your plans and invoices. Nahnu Links uses your own Stripe account, so money goes straight to you.

Before you start#
You need a Stripe account. Activate it for live payments in Stripe when you’re ready to sell; until then you can use test mode.
Connect#
- In Stripe, open Developers > API keys.
- In Nahnu Links, go to Settings > Subscriptions > Stripe. Choose Test mode first.
- Paste the publishable key (starts with
pk_test_) and the secret key (starts withsk_test_). The secret key is stored privately and never shown again. - Click Test connection.
Set up the webhook#
The webhook lets Stripe tell your site about payments it confirms later, like bank authentication that finishes after the page is closed, and about refunds you make in Stripe.
- In Stripe, open Developers > Webhooks > Add destination.
- Paste the address Nahnu Links shows, like
https://yoursite.com/wp-json/nl/v1/stripe/webhook. - Pick these events:
| Event | Why |
|---|---|
payment_intent.succeeded | A payment went through. |
payment_intent.payment_failed | A payment failed. |
setup_intent.succeeded | A card was saved for renewals. |
charge.refunded | You refunded a payment in Stripe. |
- Copy the signing secret from Stripe into Nahnu Links. It proves each event really came from Stripe.
The Stripe card shows when the last event arrived.
Test a purchase#
In test mode, buy a plan on your pricing page with Stripe’s test card 4242 4242 4242 4242, any future date and any CVC. Check that:
- the subscription appears on Billing;
- an invoice is made and marked paid;
- the Stripe card shows a recent webhook event.
Go live#
Once a test purchase works end to end, switch to Live and add your live keys (pk_live_, sk_live_) and a live webhook with its own signing secret. Test and live are completely separate in Stripe, so the webhook must be added again in live mode.
Security#
- The secret key and signing secret stay on your site and are never sent to the browser.
- Card details go straight from the buyer’s browser to Stripe. They never touch your site.


