N Docs
← Back to site

Connect Stripe

2 min readUpdated November 23, 2026

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

The Stripe card with test keys and Test connection, and the webhook address

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#

  1. In Stripe, open Developers > API keys.
  2. In Nahnu Links, go to Settings > Subscriptions > Stripe. Choose Test mode first.
  3. Paste the publishable key (starts with pk_test_) and the secret key (starts with sk_test_). The secret key is stored privately and never shown again.
  4. 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.

  1. In Stripe, open Developers > Webhooks > Add destination.
  2. Paste the address Nahnu Links shows, like https://yoursite.com/wp-json/nl/v1/stripe/webhook.
  3. Pick these events:
EventWhy
payment_intent.succeededA payment went through.
payment_intent.payment_failedA payment failed.
setup_intent.succeededA card was saved for renewals.
charge.refundedYou refunded a payment in Stripe.
  1. 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.

If payments or webhooks fail#

See Stripe payments or webhooks fail.