feat(v2): outbox 退款感知(refund_id 进唯一键)+ 投递门禁放行退款态 + Enqueue 贯通 refundID
This commit is contained in:
@@ -43,13 +43,14 @@ func NewNotifier(ws *store.WebhookStore, bizConfig BizConfigFunc, orderPaid Orde
|
||||
}
|
||||
|
||||
// Enqueue implements gateway.WebhookEnqueuer: serialize the domain payload and
|
||||
// idempotently persist it to the outbox (delivery happens async).
|
||||
func (n *Notifier) Enqueue(outTradeNo, bizSystem, eventType string, data map[string]any) error {
|
||||
// idempotently persist it to the outbox (delivery happens async). refundID is
|
||||
// the refund's idempotency dimension (payment events pass "").
|
||||
func (n *Notifier) Enqueue(outTradeNo, bizSystem, eventType, refundID string, data map[string]any) error {
|
||||
body, err := json.Marshal(data)
|
||||
if err != nil {
|
||||
return fmt.Errorf("webhook.Enqueue marshal: %w", err)
|
||||
}
|
||||
return n.deliveries.EnqueueDelivery(outTradeNo, bizSystem, eventType, string(body))
|
||||
return n.deliveries.EnqueueDelivery(outTradeNo, bizSystem, eventType, refundID, string(body))
|
||||
}
|
||||
|
||||
// DeliverPending flushes undelivered rows; returns how many succeeded this pass.
|
||||
|
||||
Reference in New Issue
Block a user