This commit is contained in:
suyl
2021-08-02 11:13:10 +08:00
parent e6ea1adef7
commit 6f5644325d
12 changed files with 151 additions and 17 deletions

View File

@@ -0,0 +1,47 @@
package alipayapi
import (
"git.rosy.net.cn/baseapi/utils"
"testing"
)
func TestCreatePay(t *testing.T) {
result, err := api.CreatePay(&CreatePayParam{
OutTradeNo: utils.GetUUID(),
TotalAmount: 0.01,
Subject: "测试订单",
StoreID: "100000",
BuyerID: "2088912877320980",
})
if err != nil {
t.Fatal(err)
}
t.Log(utils.Format4Output(result, false))
}
func TestCreatePay2(t *testing.T) {
result, err := api.CreatePay2(&CreatePayParam2{
OutTradeNo: "21175111420002544",
TotalAmount: 0.01,
Subject: "xxx店",
StoreID: "100000",
QuitURL: "http://www.jxc4.com",
ProductCode: "QUICK_WAP_WAY",
})
if err != nil {
t.Fatal(err)
}
t.Log(utils.Format4Output(result, false))
}
func TestCreatePay3(t *testing.T) {
result, err := api.CreatePay3(&CreatePayParam3{
TotalAmount: 0.01,
StoreID: "2021072600077000000025212127",
OutTradeNo: utils.GetUUID(),
})
if err != nil {
t.Fatal(err)
}
t.Log(utils.Format4Output(result, false))
}