Provider Guide

Stripe

Receive Stripe payment events locally, verify signatures, and replay events without re-triggering real charges.

1. Start the CLI

bash
npx @anonymilyhq/cli listen 3000

Copy the printed URL (e.g. https://api.anonymily.com/h/svh8zfse).

2. Add endpoint in Stripe Dashboard

  1. Go to Stripe Dashboard → Developers → Webhooks → Add endpoint.
  2. Paste your Anonymily URL as the endpoint URL.
  3. Select the events you want to receive (e.g. payment_intent.succeeded).
  4. Copy the signing secret (whsec_...) shown after creation.

3. Verify the signature in your handler

node.js
const stripe = require('stripe')(process.env.STRIPE_SECRET_KEY); app.post('/webhook', express.raw({ type: 'application/json' }), (req, res) => { const sig = req.headers['stripe-signature']; let event; try { event = stripe.webhooks.constructEvent( req.body, // raw Buffer — do NOT use express.json() for this route sig, process.env.STRIPE_WEBHOOK_SECRET // whsec_... ); } catch (err) { return res.status(400).send(`Webhook Error: ${err.message}`); } console.log('Event type:', event.type); res.json({ received: true }); });

4. Trigger & replay events

Use the Stripe Dashboard "Send test webhook" to trigger an event. Once captured in Anonymily, you can replay it from the dashboard without re-triggering the actual charge — useful for iterating on handler logic.

Single replay is unlimited on every tier (within retention); modify & bulk replay are Pro. See Pricing.

← All providers