ABhome Admission handles enrollment and paid events for 1,000+ applicants. I built the paid-event module: Midtrans Snap checkout, a webhook that drives payment status, and promo codes. Two decisions in that module are about being honest regarding what has not happened yet.

The ticket has five states

A ticket moves through pending, paid, denied, cancelled, and expired. Nobody checks Midtrans by hand. The webhook reports a change, and the app verifies the SHA-512 signature before it touches any status.

Midtrans documents the signature as a SHA-512 hash of the order ID, status code, gross amount, and your server key. This is a sketch of the handler, not the production code:

$expected = hash('sha512', $orderId . $statusCode . $grossAmount . $serverKey); if (! hash_equals($expected, $payload['signature_key'])) { abort(403); } $status = match ($payload['transaction_status']) { 'settlement' => 'paid', 'deny' => 'denied', 'cancel' => 'cancelled', 'expire' => 'expired', default => 'pending', }; 

The default branch matters. Anything the app has not confirmed stays pending.

Promo usage counts after settlement

Promo codes have date windows, a minimum participant count, usage caps, and partial discounts when a promo covers only some of the seats. A promo use counts only once the payment settles.

If the count went up when someone opened checkout, the cap would be used up by people who never pay. Counting at settlement keeps the cap tied to real tickets. Retried webhooks need one more guard in a real system: count each ticket once.

The pattern

A system should say "not yet" when it means "not yet". A podcast on leadership made the same point about teams, that people know when things are not fine, so pretending all is well does not help. Pending is a status worth showing.

Which status in your system gets mistaken for "done" most often?