- 结算初始版本
This commit is contained in:
45
business/partner/purchase/mtwm/financial_test.go
Normal file
45
business/partner/purchase/mtwm/financial_test.go
Normal file
@@ -0,0 +1,45 @@
|
||||
package mtwm
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/url"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/baseapi/platformapi/mtwmapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
)
|
||||
|
||||
func TestOnFinancialMsg(t *testing.T) {
|
||||
msg := &mtwmapi.CallbackMsg{
|
||||
Cmd: "orderPartialRefund",
|
||||
Data: url.Values{},
|
||||
}
|
||||
msg.Data.Set("timestamp", utils.Int64ToStr(time.Now().Unix()))
|
||||
msg.Data.Set("order_id", "123458")
|
||||
msg.Data.Set("notify_type", "agree")
|
||||
msg.Data.Set("money", "23.56")
|
||||
food := []map[string]interface{}{
|
||||
map[string]interface{}{
|
||||
"app_food_code": "123",
|
||||
"food_name": "商品1",
|
||||
"sku_id": "123",
|
||||
"refund_price": 3.14,
|
||||
"count": 2,
|
||||
"box_num": 1,
|
||||
"box_price": 1,
|
||||
},
|
||||
map[string]interface{}{
|
||||
"app_food_code": "124",
|
||||
"food_name": "商品2",
|
||||
"sku_id": "124",
|
||||
"refund_price": 3.15,
|
||||
"count": 2,
|
||||
"box_num": 1,
|
||||
"box_price": 1,
|
||||
},
|
||||
}
|
||||
msg.Data.Set("food", string(utils.MustMarshal(food)))
|
||||
res := OnFinancialMsg(msg)
|
||||
fmt.Println(res)
|
||||
}
|
||||
Reference in New Issue
Block a user