Production is locked until a market agreement is recorded

wh_payments

https://api.bissaufoods.example/palopgo/payments

failing62% in 24 h5 events

Settings

How this endpoint is configured

URL
https://api.bissaufoods.example/palopgo/payments
Signing secret
whsec_0c44················
Created
Mon 7 Sep
Last delivery
11 min ago
Failure alerts
plataforma@bissaufoods.example · +245 955 221 104

Subscription

Events this endpoint receives

  • payment.*
    • payment.pushed
    • payment.confirmed
    • payment.failed
    • payment.expired
    • payment.refunded

Verify

Check the signature before you trust the body

The header carries the timestamp and one or more signatures. Reject anything older than five minutes, and compare in constant time.

verify.ts
import crypto from "node:crypto"; export function verify(rawBody, header, secret) {  // one t, one or more v1 — a rotating secret sends both signatures.  const pairs = header.split(",").map((p) => p.trim().split("="));  const t = pairs.find(([k]) => k === "t")?.[1];  const signatures = pairs.filter(([k]) => k === "v1").map(([, v]) => v);  if (!t || signatures.length === 0) return false;  if (Math.abs(Date.now() / 1000 - Number(t)) > 300) return false;   const expected = Buffer.from(    crypto.createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex"),  );  return signatures.some((sig) => {    const given = Buffer.from(sig);    return given.length === expected.length && crypto.timingSafeEqual(expected, given);  });}

Test

Send a test event

Recent

Last deliveries

  • 17:31payment.confirmed70 ms200
  • 17:14payment.confirmed215 ms200
  • 16:41payment.pushed236 ms200
  • 16:18payment.confirmed307 ms200
  • 16:18payment.pushed159 ms200
  • 12:40payment.confirmed9943 ms500