data 透传闭环:发货数据回显、回调带回,并限制 2KB

- 「查询发货数据」响应新增 data(下单透传原样回显,供自建发货页预填/展示)
- 回调 payload 带回 data(下单传 → 回调收,商户对接免回查)
- 创建订单 data 限制最长 2048 字节
- 文档更新:data 用途(自建页预填/回调/上游查单约定字段)、发货数据与回调示例
- 单测覆盖 data 回显
This commit is contained in:
yml2213
2026-08-03 14:32:08 +08:00
parent a44f58cd0f
commit f95075e2e4
6 changed files with 36 additions and 5 deletions
@@ -221,6 +221,10 @@ func TestDeliveryMerchantApiBindAndSubmit(t *testing.T) {
APIClientID: 1,
ClientOrderNo: "delivery-api-001",
SKU: "suit_alan_walker",
RequestData: map[string]interface{}{
"game_account": "4808146277",
"game_channel": "ios-wechat",
},
})
if err != nil {
t.Fatalf("create order: %v", err)
@@ -234,6 +238,9 @@ func TestDeliveryMerchantApiBindAndSubmit(t *testing.T) {
if !info.CanShip || info.Product == nil || info.Product.Image == "" {
t.Fatalf("merchant order should include delivery data: %+v", info)
}
if info.Data["game_account"] != "4808146277" || info.Data["game_channel"] != "ios-wechat" {
t.Fatalf("delivery order should echo request data: %+v", info.Data)
}
bind, err := deliverySvc.BindForMerchant(merchantID, created.Order.OrderNo, "4808146277")
if err != nil {