1 Star 0 Fork 140

opsfast / go支付合集

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
pay_test.go 907 Bytes
一键复制 编辑 原始数据 按行查看 历史
shirdon 提交于 2018-11-27 15:26 . 支付库调试上传
package pays_with_go
import (
"fmt"
"./client"
"./common"
"./constant"
"net/http"
"testing"
)
//测试
func TestPay(t *testing.T) {
initClient()
initHandle()
charge := new(common.Charge)
charge.PayMethod = constant.WECHAT
charge.MoneyFee = 1
charge.Describe = "测试订单"
charge.TradeNum = "8888888888"
fdata, err := do(charge)
if err != nil {
t.Error(err)
}
fmt.Println(fdata)
}
//初始化客户端
func initClient() {
client.InitAliAppClient(&client.AliAppClient{
PartnerID: "xxx",
SellerID: "xxxx",
AppID: "xxx",
PrivateKey: nil,
PublicKey: nil,
})
}
//初始化处理
func initHandle() {
http.HandleFunc("callback/aliappcallback", func(w http.ResponseWriter, r *http.Request) {
aliResult, err := AliAppCallback(w, r)
if err != nil {
fmt.Println(err)
//log.xxx
return
}
selfHandler(aliResult)
})
}
func selfHandler(i interface{}) {
}
Go
1
https://gitee.com/opsfast/pays_with_go.git
git@gitee.com:opsfast/pays_with_go.git
opsfast
pays_with_go
go支付合集
master

搜索帮助