๐ก๏ธ Template #22363: Detect Payment Fraud and Deduplicate Webhooks with DevDeskApp, PostgreSQL, and Slack โ
Published on n8n.ioTemplate ID: 22363
๐ Template on n8n.io: n8n.io/workflows/22363

Figure 1: The template on the n8n canvas.
๐ฏ Overview โ
High-growth e-commerce platforms and SaaS businesses face two critical payment webhook challenges:
- Duplicate Webhook Retries: Payment providers (Stripe, Razorpay, Shopify) retry delivery when servers take too long to reply, causing duplicate order fulfillments or duplicate digital credit top-ups.
- Fraudulent Chargebacks & Suspicious Orders: High-ticket purchases made with disposable emails, proxy IPs, or mismatched billing addresses often slip through without automated risk scoring.
This template creates an automated zero-trust gate before fulfilling orders:
- Calculates SHA-256 Idempotency Checksum: Hashes the transaction ID, currency, and amount with DevDeskApp Hash Payload into a deterministic key to instantly detect webhook replays.
- Issues Audit UUID v4: Assigns a unique correlation token across PostgreSQL and ledger logs with DevDeskApp UUID Generator.
- PII Sanitization & Slugification: Normalizes customer names and email domains into clean audit slugs (
order-8921-sarah-connor) with DevDeskApp Slugify String without leaking raw PII. - Automated Quarantine Gate: Splits verified payments for instant database fulfillment, while quarantining suspicious orders into
#security-alertsin Slack.
๐ธ Pipeline โ

Figure 2: Node order and branches in the published template.
| Node | Resource ยท Operation | Purpose |
|---|---|---|
| Payment Webhook (Stripe / Shopify) | trigger ยท webhook | Ingests live payment event (charge.succeeded or payment_intent.succeeded) |
| DevDeskApp: JSON Prettifier | json ยท prettify | Validates and cleans raw webhook JSON formatting |
| DevDeskApp: SHA-256 Idempotency Hasher | crypto ยท hash (sha256) | Checksum of transactionId + amount to prevent replay attacks |
| DevDeskApp: Trace UUID Generator | crypto ยท uuid | Distributed tracking ID across internal microservices |
| DevDeskApp: Customer Slugifier | text ยท slugify | Generates standardized order reference slug |
| If: Duplicate / High Risk? | if | Evaluates risk score, disposable email flag, and existing DB checksum |
| PostgreSQL: Ingest Order | Postgres node | Inserts verified payment record into production database |
| Slack: Security / Order Alert | Slack node | Alerts team of verified order or urgent fraud quarantine |
โก Execution sample โ
json
{
"status": "ORDER_VERIFIED",
"auditToken": "8f2d5a1b-4c3e-4d9f-a6b8-2c7e1f4a9b0c",
"orderSlug": "ord-98214-elena-rostova",
"gateway": "stripe_live",
"transactionId": "ch_3N82kls8921klsa",
"amountFormatted": "$249.00 USD",
"riskAssessment": {
"riskScore": 12,
"verdict": "LOW_RISK_ACCEPTED",
"idempotencyHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
},
"database": {
"table": "ecommerce_orders",
"inserted": true,
"idempotencyKeyStored": true
}
}๐ฅ Import it โ
- Make sure
n8n-nodes-devdeskappis installed (installation guide). - Open the template on n8n.io and click Use for free, or copy the workflow JSON.
- Paste it onto a new workflow canvas with
Ctrl + V(Cmd + Von macOS). - Configure your Stripe Webhook Secret, PostgreSQL connection, and Slack channel.
- Test using the sample webhook event and verify zero-delay in-memory checksum computation.

