微信分账接口

This commit is contained in:
苏尹岚
2020-02-04 17:42:34 +08:00
parent 68ea2b6c4b
commit 9f7d251b6f
2 changed files with 75 additions and 2 deletions

View File

@@ -44,7 +44,7 @@ func TestCreateUnifiedOrder(t *testing.T) {
OutTradeNo: orderNo,
SpbillCreateIP: "114.114.114.114",
TradeType: TradeTypeNative,
TotalFee: 1,
TotalFee: 2,
})
if err != nil {
t.Fatal(err)
@@ -101,3 +101,47 @@ func TestXml2Json(t *testing.T) {
}
t.Log(utils.Format4Output(mv, false))
}
func TestMultiProfitSharing(t *testing.T) {
result, err := api.MultiProfitSharing(&MultiProfitSharing{
TransactionID: "4200000508202002040201497455",
OutOrderNo: "6E74BA38472F11EA8BB87824AF852DFE",
Receivers: `[{"type":"PERSONAL_WECHATID","account":"wxid_r93tvy06srbp22","amount":10,"description":"分到个人"}]`,
})
if err != nil {
t.Fatal(err)
}
t.Log(utils.Format4Output(result, false))
}
func TestTransfers(t *testing.T) {
orderNo := utils.GetUUID()
result, err := api.Transfers(&Transfers{
PartnerTradeNo: orderNo,
OpenID: "oylsKxEeRKJSdo1OE2aA1fRloaN4",
CheckName: "FORCE_CHECK",
ReUserName: "苏尹岚",
Amount: 100,
Desc: "测试",
SpbillCreateIP: "114.114.114.114",
})
if err != nil {
t.Fatal(err)
}
t.Log(utils.Format4Output(result, false))
}
func TestAddProfitSharingReceiver(t *testing.T) {
result, err := api.AddProfitSharingReceiver(&AddProfitSharingReceiver{
Receiver: `{
"type": "PERSONAL_WECHATID",
"account":"wxid_r93tvy06srbp22",
"name": "苏尹岚",
"relation_type": "STAFF"
}`,
})
if err != nil {
t.Fatal(err)
}
t.Log(utils.Format4Output(result, false))
}