微信支付CreateUnifiedOrder

微信API,入统一为struct,出统一用mxj再转struct
This commit is contained in:
gazebo
2019-11-19 18:28:04 +08:00
parent 57d00d1bc7
commit ed010619f1
3 changed files with 234 additions and 95 deletions

View File

@@ -29,3 +29,18 @@ func TestOrderQuery(t *testing.T) {
}
t.Log(utils.Format4Output(result, false))
}
func TestCreateUnifiedOrder(t *testing.T) {
result, err := api.CreateUnifiedOrder(&CreateOrderParam{
Body: "这里一个测试商品",
NotifyURL: "http://callback.test.jxc4.com/wxpay/msg/",
OutTradeNo: utils.GetUUID(),
SpbillCreateIP: "114.114.114.114",
TradeType: TradeTypeNative,
TotalFee: 1,
})
if err != nil {
t.Fatal(err)
}
t.Log(utils.Format4Output(result, false))
}