NATSpayment.order.reconcile.diff订单对账差异(JetStream 事件)

payment_worker 对账扫描(直连只读支付库,比对渠道账单与订单表)发现差异后发布、payment_service 消费并处置。此方向为单向流,无回复。

Request Payload

消息格式:JSON

NameData TypeRequiredDescription
eventIdstringYes事件 ID(JetStream 消息去重键)
orderIdstringYes差异订单 ID
diffTypestringYes渠道已扣款未入账(charged_unrecorded)/ 已入账未扣款(recorded_uncharged)/ 金额不一致(amount_mismatch)
expectedAmountnumberNo本地订单金额
actualAmountnumberNo渠道实际金额
foundAtstringYes发现时间
type RequestBody = {
  /** 事件 ID(JetStream 消息去重键) */
  eventId: string
  /** 差异订单 ID */
  orderId: string
  /** 渠道已扣款未入账(charged_unrecorded)/ 已入账未扣款(recorded_uncharged)/ 金额不一致(amount_mismatch) */
  diffType: string
  /** 本地订单金额 */
  expectedAmount?: number
  /** 渠道实际金额 */
  actualAmount?: number
  /** 发现时间 */
  foundAt: string
}
{
  "eventId": "01JD8SXDBQ7O4PL",
  "orderId": "01JD8SNZFT8A1B7HB",
  "diffType": "amount_mismatch",
  "expectedAmount": 288,
  "actualAmount": 287.99,
  "foundAt": "2026-10-14T03:10:00Z"
}

Examples

{
  "eventId": "01JD8SXDBQ7O4PL",
  "orderId": "01JD8SNZFT8A1B7HB",
  "diffType": "amount_mismatch",
  "expectedAmount": 288,
  "actualAmount": 287.99,
  "foundAt": "2026-10-14T03:10:00Z"
}

Remarks

流语义:JetStream 持久化;payment_service 消费后落对账差异工单并告警,处置结果只进支付库与审计事件,不回流 worker。对账扫描 cron(RECONCILE_CRON)由 worker 配置项控制。