
Dice Payment Gateway
Crypto (CoinGate/Lightning) and card payment gateway built as its own product — consumed by Dice Proxy as a drop-in payment adapter.
Overview
Dice Payment Gateway is a crypto and card payment gateway built as its own standalone product — not bolted onto one application, but designed to be integrated by others, starting with our own Dice Proxy platform as its first real client. It wraps CoinGate for crypto settlement (including Lightning Network invoices) and Stripe for cards behind one merchant-facing API.
Key Features
- Crypto payments via CoinGate, including Bitcoin Lightning Network invoice decoding, alongside standard Stripe card payments — one API surface for both.
- Webhook-first settlement with a polling fallback — when a client integration (like Dice Proxy) can't yet receive webhooks reliably, the gateway's own invoice status can be polled on a backoff schedule until it resolves, so a payment is never silently lost.
- Merchant admin dashboard for reviewing transactions and gateway configuration, plus a public documentation site (built with Fumadocs) for merchants integrating the API.
- QR-code checkout support for crypto invoices, generated directly from the merchant/admin frontend.
Technical Highlights
- NestJS + GraphQL + Prisma + PostgreSQL backend, with the payment-provider integration isolated enough that CoinGate and Stripe are genuinely separate adapters rather than intertwined logic.
- Real production debugging that mattered: found and fixed a webhook signature format mismatch between this gateway's outbound signing (
sha256=<hex>) and a client's expected raw-hex format — a bug that would have made every signature check silently fail-closed — verified with a one-line reproduction before shipping the fix. - Diagnosed a real production incident where a stale
ngroktunnel URL left over from local testing was still configured as the production webhook callback, silently dropping every CoinGate webhook; traced it via webhook logs and confirmed the fix end-to-end against a real invoice.
Impact
Building the payment gateway as an independent product — rather than embedding payment logic directly inside Dice Proxy — means any future project (or an external merchant) can integrate the same crypto/card payment surface without duplicating the settlement, webhook-security, or invoicing logic from scratch.


