腾讯支付回调
This commit is contained in:
26
controllers/wxpay_callback.go
Normal file
26
controllers/wxpay_callback.go
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
package controllers
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"git.rosy.net.cn/baseapi/platformapi/wxpay"
|
||||||
|
"github.com/astaxie/beego"
|
||||||
|
)
|
||||||
|
|
||||||
|
type WXPayController struct {
|
||||||
|
beego.Controller
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *WXPayController) Msg() {
|
||||||
|
if c.Ctx.Input.Method() == http.MethodPost {
|
||||||
|
var callbackResponse *wxpay.CallbackResponse
|
||||||
|
|
||||||
|
if callbackResponse == nil {
|
||||||
|
callbackResponse = wxpay.SuccessResponse
|
||||||
|
}
|
||||||
|
c.Data["xml"] = callbackResponse
|
||||||
|
c.ServeXML()
|
||||||
|
} else {
|
||||||
|
c.Abort("404")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -133,6 +133,7 @@ func init() {
|
|||||||
beego.AutoRouter(&controllers.WeimobController{})
|
beego.AutoRouter(&controllers.WeimobController{})
|
||||||
beego.AutoRouter(&controllers.WeixinController{})
|
beego.AutoRouter(&controllers.WeixinController{})
|
||||||
beego.AutoRouter(&controllers.DingDingController{})
|
beego.AutoRouter(&controllers.DingDingController{})
|
||||||
|
beego.AutoRouter(&controllers.WXPayController{})
|
||||||
|
|
||||||
// 如下都是用于检测存活的空接口
|
// 如下都是用于检测存活的空接口
|
||||||
beego.Any("/", func(ctx *beecontext.Context) {
|
beego.Any("/", func(ctx *beecontext.Context) {
|
||||||
|
|||||||
Reference in New Issue
Block a user