NATSpayment.subscription.renewal.due订阅续订到期(JetStream 事件)
Try it 面板需要启用 JavaScript。
payment_worker 定时扫描(直连只读支付库)发现即将到期的订阅后发布、payment_service 消费并执行扣款续订。此方向为单向流,无回复。
Request Payload
消息格式:JSON
| Name | Data Type | Required | Description |
|---|---|---|---|
| eventId | string | Yes | 事件 ID(JetStream 消息去重键) |
| subscriptionId | string | Yes | 订阅 ID |
| userId | string | Yes | 用户 ID |
| amount | number | Yes | 本期金额 |
| currency | string | Yes | 币种 |
| dueAt | string | Yes | 到期时间 |
type RequestBody = {
/** 事件 ID(JetStream 消息去重键) */
eventId: string
/** 订阅 ID */
subscriptionId: string
/** 用户 ID */
userId: string
/** 本期金额 */
amount: number
/** 币种 */
currency: string
/** 到期时间 */
dueAt: string
}{
"eventId": "01JD8SXCAP6N3OK",
"subscriptionId": "01JD8SOBHV0C3D9JD",
"userId": "01JD8SEGQ0P9N2XK4L7VDH3T6C",
"amount": 28,
"currency": "USD",
"dueAt": "2026-11-13T09:00:00Z"
}Examples
{
"eventId": "01JD8SXCAP6N3OK",
"subscriptionId": "01JD8SOBHV0C3D9JD",
"userId": "01JD8SEGQ0P9N2XK4L7VDH3T6C",
"amount": 28,
"currency": "USD",
"dueAt": "2026-11-13T09:00:00Z"
}
Remarks
流语义:JetStream 持久化;payment_service 消费后扣款,成功生成续订订单并入账,失败按 SUBSCRIPTION_RETRY_MAX 重试、超限将订阅转 expired。扣款结果不再向 worker 回流——worker 只负责发现到期。