{"now":"2026-11-18T06:00:00.000Z"}
== the payee is the counselor's own number, frozen at acceptance
patient GET /bookings/bkg_01m7pkx1b04fjp5s9tbsq67qr9 -> 200


{"status":"awaiting_payment","holdUntil":"2026-11-18T06:16:00.000Z","payment":null,"paymentInfo":{"accountNumber":"+251911000111","accountName":"Hanna Tesfaye","method":"mobile_wallet","amountSantim":80000,"lateUntil":null},"refund":null}

== a good receipt: read at once, the booking is confirmed, nobody had to look
patient POST /bookings/bkg_01m7pkx1b04fjp5s9tbsq67qr9/payment -> 200


{"status":"confirmed","holdUntil":null,"payment":{"state":"verified","rejectReason":null,"late":false,"senderNameDiffers":false,"transactionId":"GOODTX0001","review":null},"paymentInfo":null,"refund":null}

admin GET /admin/payments -> 200
{"items":[{"id":"bkg_01m7pkx1b04fjp5s9tbsq67qr9","status":"confirmed","counselor":{"id":"prv_01m7pkv6r01n8ghaw5hzerv6vx","name":"Hanna Tesfaye","title":"Clinical psychologist"},"patient":{"id":"prn_01m7pkv6r01n8ghaw5hzerv704","name":"Abel Mekonnen","seenBefore":false},"start":"2026-11-19T06:00:00.000Z","end":"2026-11-19T06:50:00.000Z","lengthMinutes":50,"mode":"online","feeSantim":80000,"note":null,"location":null,"meetLink":"https://meet.google.com/abc-defg-hij","joinOpensAt":"2026-11-19T05:50:00.000Z","replyDueAt":null,"holdUntil":null,"declineReason":null,"cancelledBy":null,"cancelReason":null,"payment":{"id":"pay_01m7pkx1b04fjp5s9tbsq67qrv","state":"verified","amountSantim":80000,"transactionId":"GOODTX0001","receiptLink":"https://transactioninfo.ethiotelecom.et/receipt/GOODTX0001","payerName":"Abel Mekonnen","senderNameDiffers":false,"submittedAt":"2026-11-18T06:01:00.000Z","rejectReason":null,"late":false,"review":{"expected":{"amountSantim":80000,"receiverPhone":"+251911000111","receiverName":"Hanna Tesfaye","notBefore":"2026-11-18T05:56:00.000Z","notAfter":"2026-11-18T06:06:0

== the same receipt again is refused (used once); another amount is rejected with its reason and a fresh hold
patient POST /bookings/bkg_01m7pkx1b04fjp5s9tbsq67qsx/payment -> 409


{"status":null,"holdUntil":null,"payment":null,"paymentInfo":null,"refund":null}

patient POST /bookings/bkg_01m7pkx1b04fjp5s9tbsq67qsx/payment -> 200


{"status":"awaiting_payment","holdUntil":"2026-11-18T06:16:00.000Z","payment":{"state":"rejected","rejectReason":"wrong_amount","late":false,"senderNameDiffers":false,"transactionId":"WRONGAMT01","review":null},"paymentInfo":{"accountNumber":"+251911000111","accountName":"Hanna Tesfaye","method":"mobile_wallet","amountSantim":80000,"lateUntil":null},"refund":null}

admin GET /bookings/bkg_01m7pkx1b04fjp5s9tbsq67qsx -> 200


{"status":"awaiting_payment","holdUntil":"2026-11-18T06:16:00.000Z","payment":{"state":"rejected","rejectReason":"wrong_amount","late":false,"senderNameDiffers":false,"transactionId":"WRONGAMT01","review":{"checkResult":"mismatch","failedChecks":["amount"],"readAmount":70000}},"paymentInfo":null,"refund":null}

patient GET /notifications -> 200
{"items":[{"id":"msg_01m7pkx1b04fjp5s9tbsq67qtx","kind":"payment_rejected","text":{"key":"notification.payment_rejected"},"link":{"screen":"booking","id":"bkg_01m7pkx1b04fjp5s9tbsq67qsx"},"createdAt":"2026-11-18T06:01:00.000Z","readAt":null},{"id":"msg_01m7pkx1b04fjp5s9tbsq67qt8","kind":"booking_accepted","text":{"key":"notification.booking_accepted"},"link":{"screen":"booking","id":"bkg_01m7pkx1b04fjp5s9tbsq67qsx"},"createdAt":"2026-11-18T06:01:00.000Z","readAt":null},{"id":"msg_01m7pkx1b04fjp5s9tbsq67qs8","kind":"payment_verified","text":{"key":"notification.payment_verified"},"link":{"screen":"booking","id":"bkg_01m7pkx1b04fjp5s9tbsq67qr9"},"createdAt":"2026-11-18T06:01:00.000Z","readAt":null},{"id":"msg_01m7pkx1b04fjp5s9tbsq67qrm","kind":"booking_accepted","text":{"key":"notification.booking_accepted"},"link":{"screen":"booking","id":"bkg_01m7pkx1b04fjp5s9tbsq67qr9"},"createdAt":"2026-11-18T06:01:00.000Z","readAt":null}],"nextCursor":null,"unread":4}

== other receiver, and a receipt the service saw confirmed before
patient POST /bookings/bkg_01m7pkx1b04fjp5s9tbsq67qsx/payment -> 200


{"status":"awaiting_payment","holdUntil":"2026-11-18T06:16:00.000Z","payment":{"state":"rejected","rejectReason":"wrong_receiver","late":false,"senderNameDiffers":false,"transactionId":"OTHERRCV01","review":null},"paymentInfo":{"accountNumber":"+251911000111","accountName":"Hanna Tesfaye","method":"mobile_wallet","amountSantim":80000,"lateUntil":null},"refund":null}

patient POST /bookings/bkg_01m7pkx1b04fjp5s9tbsq67qsx/payment -> 200


{"status":"awaiting_payment","holdUntil":"2026-11-18T06:16:00.000Z","payment":{"state":"rejected","rejectReason":"reused","late":false,"senderNameDiffers":false,"transactionId":"USEDTX0001","review":null},"paymentInfo":{"accountNumber":"+251911000111","accountName":"Hanna Tesfaye","method":"mobile_wallet","amountSantim":80000,"lateUntil":null},"refund":null}

== a queued check: held and checking; the signed webhook completes it, once
patient POST /bookings/bkg_01m7pkx1b04fjp5s9tbsq67qwp/payment -> 200


{"status":"awaiting_payment","holdUntil":"2026-11-18T06:16:00.000Z","payment":{"state":"submitted","rejectReason":null,"late":false,"senderNameDiffers":false,"transactionId":"QUEUEDTX01","review":null},"paymentInfo":{"accountNumber":"+251911000111","accountName":"Hanna Tesfaye","method":"mobile_wallet","amountSantim":80000,"lateUntil":null},"refund":null}

admin GET /bookings/bkg_01m7pkx1b04fjp5s9tbsq67qwp -> 200


{"status":"awaiting_payment","holdUntil":"2026-11-18T06:16:00.000Z","payment":{"state":"submitted","rejectReason":null,"late":false,"senderNameDiffers":false,"transactionId":"QUEUEDTX01","review":{"checkResult":"checking","failedChecks":[],"readAmount":null}},"paymentInfo":null,"refund":null}

-- wrong secret, an old timestamp, and no signature are refused
webhook -> 401 {"code":"unauthenticated"}

webhook -> 401 {"code":"unauthenticated"}

webhook (unsigned) -> 401

patient GET /bookings/bkg_01m7pkx1b04fjp5s9tbsq67qwp -> 200


{"status":"awaiting_payment","holdUntil":"2026-11-18T06:16:00.000Z","payment":{"state":"submitted","rejectReason":null,"late":false,"senderNameDiffers":false,"transactionId":"QUEUEDTX01","review":null},"paymentInfo":{"accountNumber":"+251911000111","accountName":"Hanna Tesfaye","method":"mobile_wallet","amountSantim":80000,"lateUntil":null},"refund":null}

-- the good one, then the same event again, then a test ping, then junk
webhook -> 200 {"ok":true}

patient GET /bookings/bkg_01m7pkx1b04fjp5s9tbsq67qwp -> 200


{"status":"confirmed","holdUntil":null,"payment":{"state":"verified","rejectReason":null,"late":false,"senderNameDiffers":false,"transactionId":"QUEUEDTX01","review":null},"paymentInfo":null,"refund":null}

webhook -> 200 {"ok":true}

webhook -> 204 

webhook -> 400 {"code":"validation_failed"}

counselor GET /notifications -> 200
{"items":[{"id":"msg_01m7pkyvy0vf192850w9xa5dsv","kind":"payment_verified","text":{"key":"notification.payment_verified"},"link":{"screen":"booking","id":"bkg_01m7pkx1b04fjp5s9tbsq67qwp"},"createdAt":"2026-11-18T06:02:00.000Z","readAt":null},{"id":"msg_01m7pkx1b04fjp5s9tbsq67qwt","kind":"booking_requested","text":{"key":"notification.booking_requested"},"link":{"screen":"requests","id":"bkg_01m7pkx1b04fjp5s9tbsq67qwp"},"createdAt":"2026-11-18T06:01:00.000Z","readAt":null},{"id":"msg_01m7pkx1b04fjp5s9tbsq67qw5","kind":"payment_rejected","text":{"key":"notification.payment_rejected"},"link":{"screen":"booking","id":"bkg_01m7pkx1b04fjp5s9tbsq67qsx"},"createdAt":"2026-11-18T06:01:00.000Z","readAt":null},{"id":"msg_01m7pkx1b04fjp5s9tbsq67qvk","kind":"payment_rejected","text":{"key":"notification.payment_rejected"},"link":{"screen":"booking","id":"bkg_01m7pkx1b04fjp5s9tbsq67qsx"},"createdAt":"2026-11-18T06:01:00.000Z","readAt":null},{"id":"msg_01m7pkx1b04fjp5s9tbsq67qty","kind":"payment_rejected","text":{"key":"notification.payment_rejected"},"link":{"screen":"booking","id":"bkg_01m7pkx1b0

== a receipt after the time ran out: still taken for 24 hours; verified, the slot is not reclaimed and the counselor owes a full refund
{"now":"2026-11-18T06:22:00.000Z"}
patient GET /bookings/bkg_01m7pkyvy0vf192850w9xa5dte -> 200


{"status":"expired","holdUntil":null,"payment":null,"paymentInfo":{"accountNumber":"+251911000111","accountName":"Hanna Tesfaye","method":"mobile_wallet","amountSantim":80000,"lateUntil":"2026-11-19T06:17:00.000Z"},"refund":null}

patient POST /bookings/bkg_01m7pkyvy0vf192850w9xa5dte/payment -> 200


{"status":"expired","holdUntil":null,"payment":{"state":"verified","rejectReason":null,"late":true,"senderNameDiffers":false,"transactionId":"LATETX0001","review":null},"paymentInfo":null,"refund":{"id":"rfd_01m7pn3ft03sy53wxx9yqyxrg2","state":"due","amountSantim":80000,"payerName":"Abel Mekonnen","payerPhone":null,"refundToPhone":null,"externalReference":null,"markedAt":null}}

counselor GET /counselor/refunds -> 200
{"items":[{"booking":{"id":"bkg_01m7pkyvy0vf192850w9xa5dte","status":"expired","counselor":{"id":"prv_01m7pkv6r01n8ghaw5hzerv6vx","name":"Hanna Tesfaye","title":"Clinical psychologist"},"patient":{"id":"prn_01m7pkv6r01n8ghaw5hzerv704","name":"Abel Mekonnen","seenBefore":false},"start":"2026-11-19T12:00:00.000Z","end":"2026-11-19T12:50:00.000Z","lengthMinutes":50,"mode":"online","feeSantim":80000,"note":null,"location":null,"meetLink":null,"joinOpensAt":null,"replyDueAt":null,"holdUntil":null,"declineReason":null,"cancelledBy":null,"cancelReason":null,"payment":{"id":"pay_01m7pn3ft03sy53wxx9yqyxrfv","state":"verified","amountSantim":80000,"transactionId":"LATETX0001","receiptLink":null,"payerName":"Abel Mekonnen","senderNameDiffers":false,"submittedAt":"2026-11-18T06:22:00.000Z","rejectReason":null,"late":true,"review":null},"refund":{"id":"rfd_01m7pn3ft03sy53wxx9yqyxrg2","state":"due","amountSantim":80000,"payerName":"Abel Mekonnen","payerPhone":null,"refundToPhone":null,"externalReference":null,"markedAt":null},"cancelWindowHours":24,"owedIfVerifiedSantim":null,"paymentInfo":null,"c

patient GET /notifications -> 200
{"items":[{"id":"msg_01m7pn3ft03sy53wxx9yqyxrg8","kind":"payment_late","text":{"key":"notification.payment_late"},"link":{"screen":"booking","id":"bkg_01m7pkyvy0vf192850w9xa5dte"},"createdAt":"2026-11-18T06:22:00.000Z","readAt":null},{"id":"msg_01m7pn3ft03sy53wxx9yqyxrfj","kind":"hold_expired","text":{"key":"notification.hold_expired"},"link":{"screen":"booking","id":"bkg_01m7pkyvy0vf192850w9xa5dte"},"createdAt":"2026-11-18T06:22:00.000Z","readAt":null},{"id":"msg_01m7pn3ft03sy53wxx9yqyxrfh","kind":"hold_expired","text":{"key":"notification.hold_expired"},"link":{"screen":"booking","id":"bkg_01m7pkx1b04fjp5s9tbsq67qsx"},"createdAt":"2026-11-18T06:22:00.000Z","readAt":null},{"id":"msg_01m7pkyvy0vf192850w9xa5dts","kind":"booking_accepted","text":{"key":"notification.booking_accepted"},"link":{"screen":"booking","id":"bkg_01m7pkyvy0vf192850w9xa5dte"},"createdAt":"2026-11-18T06:02:00.000Z","readAt":null},{"id":"msg_01m7pkyvy0vf192850w9xa5dst","kind":"payment_verified","text":{"key":"notification.payment_verified"},"link":{"screen":"booking","id":"bkg_01m7pkx1b04fjp5s9tbsq67qwp"},"created

