- mtwmapi.CallbackMsg.Data to FormData

This commit is contained in:
gazebo
2019-05-12 10:07:50 +08:00
parent 0f02437823
commit 3f914afbb6
6 changed files with 34 additions and 34 deletions

View File

@@ -13,13 +13,13 @@ import (
func TestOnFinancialMsg(t *testing.T) {
msg := &mtwmapi.CallbackMsg{
Cmd: "orderRefund",
Data: url.Values{},
Cmd: "orderRefund",
FormData: url.Values{},
}
msg.Data.Set("timestamp", utils.Int64ToStr(time.Now().Unix()))
msg.Data.Set("order_id", "33762863167364867")
msg.Data.Set("notify_type", "agree")
msg.Data.Set("money", "23.56")
msg.FormData.Set("timestamp", utils.Int64ToStr(time.Now().Unix()))
msg.FormData.Set("order_id", "33762863167364867")
msg.FormData.Set("notify_type", "agree")
msg.FormData.Set("money", "23.56")
food := []map[string]interface{}{
map[string]interface{}{
"app_food_code": "123",
@@ -40,7 +40,7 @@ func TestOnFinancialMsg(t *testing.T) {
"box_price": 1,
},
}
msg.Data.Set("food", string(utils.MustMarshal(food)))
msg.FormData.Set("food", string(utils.MustMarshal(food)))
res := curPurchaseHandler.onAfsOrderMsg(msg)
fmt.Println(res)
}