diff --git a/.env.example b/.env.example index eae5169..24485c2 100644 --- a/.env.example +++ b/.env.example @@ -10,6 +10,9 @@ COORDINATOR_URL=http://localhost:3000 MONITOR_TOKEN=changeme-use-a-random-secret RUST_LOG=info +# Feistel cipher for payment IDs (shared between pay + web) +FEISTEL_SECRET=changeme-use-a-random-secret + # Pay app — crypto payments FREEDOM_API=https://api-v1.freedom.st XPUB_BTC= diff --git a/apps/pay/src/receipt.ts b/apps/pay/src/receipt.ts index 602b672..a46e0b6 100644 --- a/apps/pay/src/receipt.ts +++ b/apps/pay/src/receipt.ts @@ -1,5 +1,6 @@ import sql from "./db"; import { COINS } from "../../shared/plans"; +import { encodeId } from "../../shared/feistel"; export async function generateReceipt(paymentId: number): Promise { const [payment] = await sql`SELECT * FROM payments WHERE id = ${paymentId}`; @@ -40,7 +41,7 @@ export async function generateReceipt(paymentId: number): Promise { - PingQL Receipt #${payment.id} + PingQL Receipt #${encodeId(payment.id)}