A lightweight CLI for simulating and replaying payment webhooks (starting with BTCPay).
Testing payment flows locally is painful:
- Hard to trigger real payment scenarios
- Difficult to replay webhooks
- No easy way to simulate retries or edge cases
paytunnel helps you:
- Simulate payment webhooks locally
- Store webhook events
- Replay events on demand
go build -o bin/paytunnel ./cmd/paytunnelgo run ./examples/btcpay-basicsThis starts a local webhook receiver:
http://localhost:8080/webhook/btcpay
./bin/paytunnel simulate \
--url http://localhost:8080/webhook/btcpay \
--secret my-supersecret-key \
invoice.paid./bin/paytunnel events list./bin/paytunnel events replay <delivery-id>- invoice.paid
- invoice.expired
- invoice.underpaid
- 🔁 Replay webhooks
- 🧪 Simulate payment scenarios
- 💾 Local event storage (SQLite)
- 🔐 BTCPay-compatible signature verification
internal/
repository/ # DB access
simulator/ # event generation + sending
eventlog/ # list + replay
- More payment scenarios (overpaid, late, retries)
- Webhook retry simulation
- Out-of-order delivery
- HTTP tunneling (ngrok-style)
Run example:
go run ./examples/btcpay-basicsSimulate:
./bin/paytunnel simulate --url http://localhost:8080/webhook/btcpay --secret my-supersecret-key invoice.paidMIT