4 Star 9 Fork 6

Gitee 极速下载/allpay

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/runthinker/allpay
克隆/下载
paysvc.go 856 Bytes
一键复制 编辑 原始数据 按行查看 历史
heyuehua 提交于 2018-12-17 16:03 . create
package main
import (
"github.com/julienschmidt/httprouter"
"log"
"net/http"
"allpay/svc/api"
)
func VerifyUrlSign(next httprouter.Handle) httprouter.Handle {
return func(w http.ResponseWriter, r *http.Request, p httprouter.Params) {
defer func() {
if e := recover(); e != nil {
log.Println(r.URL.Path,"Panicing error:", e)
}
}()
/*
暂时不验签
url := r.URL.Query()
params := make(common.WxParams)
for k,v := range url {
params[k] = v[0]
}
*/
next(w,r,p)
}
}
func main() {
h := httprouter.New()
h.GET("/payapi/test", func(writer http.ResponseWriter, request *http.Request, params httprouter.Params) {
writer.Write([]byte("server is ready!"))
})
h.GET("/payapi/wappay/:mode",VerifyUrlSign(api.Wap.DoPagePay))
h.POST("/payapi/notify/:paytype",api.Wap.NotifyPay)
http.ListenAndServe("localhost:3003",h)
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors/allpay.git
git@gitee.com:mirrors/allpay.git
mirrors
allpay
allpay
1bfa26d3e71c

搜索帮助