Recurnix docs

Docs › Connect Stripe

Connect Stripe

Stripe gives your clients card payments, Apple Pay and Google Pay, and — where the currency allows it — bank debits and local methods. Recurnix talks to Stripe directly over its REST API, so there is nothing to install: three values move from Stripe's dashboard into Settings → Payment gateways → Stripe, and that is the whole job.

Allow about fifteen minutes. Do it in Stripe's sandbox first unless you are in a hurry; the steps are identical and a mistake costs nothing.

The order matters. Save and enable Stripe in Recurnix before you create the webhook in Stripe. The endpoint answers 404 until Stripe is switched on here, and a webhook created against a 404 starts life marked as failing.


What you are moving across

Three values, and only the first is required to take a payment:

  • Secret key — sk_live_… or rk_live_…. This is how Recurnix asks Stripe to charge somebody. It is stored encrypted and is never shown again, here or anywhere.
  • Webhook signing secret — whsec_…. This is how Recurnix knows a message claiming to come from Stripe really did. Without it, no Stripe event is believed and a payment that completes after the client closes the tab is never recorded.
  • Publishable key — pk_live_…. Optional. Recurnix pays through Stripe's own hosted checkout page, which does not need it. The field is there for the on-site payment form; leave it blank if you like.

1. Create the key in Stripe

Open the API keys page in your Stripe dashboard.

Check the mode first. The page has a sandbox/live toggle, and each mode has an entirely separate set of keys and data. Sandbox keys read sk_test_… or rk_test_…; live keys read sk_live_… or rk_live_…. Recurnix reads the prefix and shows On — test mode on the gateway list when it is given a test key, so you can always see which world you are in.

Stripe now recommends a restricted key (rk_…) over an unrestricted secret key (sk_…), and Recurnix accepts either. A restricted key limits what a stolen key could do. If you create one, give it write access to these resources — they are every part of the Stripe API Recurnix touches:

  • Checkout Sessions, PaymentIntents, SetupIntents — taking the payment, and saving a card or bank mandate for automatic renewals.
  • Customers, Payment Methods — the client's record at Stripe and their saved methods.
  • Refunds, Disputes — refunding from the invoice, and answering a chargeback.
  • Balance (read) — the "Show balance" button and the dashboard's money card.
  • Payment Method Domains — registering your site's addresses so Apple Pay and Google Pay can appear. Skip it if you do not want wallets.

Then click Create secret key (or Create restricted key), enter the verification code Stripe sends you, name it something you will recognise in a year — Recurnix live, say — and create it.

Copy it now. Stripe shows a live key once. It cannot be revealed again. If you lose it, rotate the key and use the replacement; nothing is broken, but the old one is gone.

2. Paste the key into Recurnix

Go to Settings → Payment gateways and choose Stripe in the list on the left.

  • Paste the key into Secret key. The field is write-only: once saved, it shows Stored — leave blank to keep it and no one, including you, can read it back out of Recurnix.
  • Fill in Name on the pay page if you want something other than your company name on Stripe's checkout.
  • Card statement suffix is what your client sees on their card statement after your Stripe account's own prefix. Leave it blank for Stripe's default.
  • Tick Enabled.
  • Click Save, then Save and test connection.

The test asks Stripe who the key belongs to. A green Answered naming your Stripe account means the key is real, has the permissions it needs, and your server can reach Stripe. Anything else is worth fixing before you go further — the message says which of those three failed.

3. Create the webhook in Stripe

Stripe keeps webhooks under Workbench → Webhooks in the dashboard. Click Create an event destination, and choose Your account.

Choose Snapshot, not Thin. Stripe's dialog offers two payload formats and marks Thin as recommended. Recurnix reads the classic Snapshot format. A thin destination will deliver messages Recurnix cannot read, and nothing will be recorded.

Select these event types:

  • checkout.session.completed — the client paid.
  • checkout.session.async_payment_succeeded and checkout.session.async_payment_failed — a bank debit that settled, or did not, days later.
  • payment_intent.succeeded and payment_intent.payment_failed — an automatic renewal taken from a saved method.
  • charge.dispute.created, charge.dispute.updated, charge.dispute.closed — a chargeback opening, moving and ending.
  • payment_method.automatically_updated — a saved card the bank renewed or replaced, so the next renewal does not fail on a stale number.

Choose Webhook endpoint as the destination, and give it the address Recurnix prints on its own Stripe pane, further down the same page. It is your site's address followed by /webhooks/gateway/stripe:

https://billing.yourdomain.com/webhooks/gateway/stripe

Use the exact address your site answers on. Stripe treats a redirect as a failure, so if yourdomain.com redirects to www.yourdomain.com, register the one that answers directly.

Stripe then shows the signing secret for this endpoint, beginning whsec_. Click Reveal secret, copy it, and paste it into Webhook signing secret back in Recurnix. Save.

Each endpoint has its own signing secret, and sandbox and live are different endpoints with different secrets. Mixing them up is the single most common reason a payment completes at Stripe and never appears on the invoice.

4. Prove it works

Take one real payment — a small invoice to yourself, or a sandbox payment with Stripe's test card 4242 4242 4242 4242 and any future expiry.

Three things should be true afterwards:

  • The invoice is Paid, with a transaction naming Stripe and its reference.
  • Stripe's Event deliveries tab, under the endpoint you just made, shows the delivery with a 200.
  • Settings → Payment gateways → Stripe → Show balance returns a figure.

If you want to confirm the webhook alone, pay and close the browser tab before the return page loads. The payment should still land on the invoice within a few seconds — that is the webhook doing its job, and it is the path that matters when a client's phone loses signal mid-payment.


When it does not work

Stripe shows 404 on the endpoint. Recurnix answers 404 to a webhook for any gateway that is not both saved and ticked Enabled. Switch Stripe on, save, and use Resend on the delivery in Stripe.

Stripe shows 403. Something in front of the application is refusing Stripe. If your installation is restricted to particular addresses while you set it up, the webhook address has to be reachable by the whole internet — Stripe publishes the addresses it sends from if you would rather allow only those.

Stripe shows a redirect (301, 302). Stripe counts a redirect as a failure. Register the final address, not the one that bounces.

Deliveries succeed but nothing is recorded. The signing secret does not match — most often a sandbox secret against live keys, or the other way round. Paste it again from the endpoint you actually registered. Billing → Gateway log keeps every call and every delivery, with the reason each one was refused.

"The connection failed" on the test button. Either the key is wrong or expired, or a restricted key is missing a permission, or your server cannot reach api.stripe.com. The message says which.


Worth doing once you are live

Lock the key to your server. Stripe lets you attach an access policy to a key, restricting it to your server's outgoing IP address. A key that only works from your own machine is worth far less to anybody who steals it. You will find it under Manage access policy on the key.

Switch on the methods you want. Stripe's own dashboard controls which payment methods your account offers; Recurnix's Also offer, beside cards list controls which of them it sends to checkout. A method has to be on in both. Each is offered only on invoices in a currency it accepts.

Register your domains for wallets. Apple Pay and Google Pay appear by themselves on Stripe's hosted checkout. To offer them on your own pages, use the Register … at Stripe button on the Stripe pane — example.com and www.example.com count as two.

Keep bank debits in mind. They settle in days, not seconds. The invoice sits at payment pending meanwhile, and the later async_payment_succeeded event finishes it — which is why that event belongs on the endpoint even if you only take cards today.

Last modified: 16 November 2026 · This page documents Recurnix, self-hosted billing and automation. Ask a question.