通联宝支付测试

This commit is contained in:
苏尹岚
2020-02-27 11:48:34 +08:00
parent b187122ba7
commit 36f588178d
3 changed files with 82 additions and 40 deletions

View File

@@ -3,6 +3,12 @@ package controllers
import (
"net/http"
"git.rosy.net.cn/jx-callback/globals/api"
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/partner/purchase/jx/localjx"
"git.rosy.net.cn/jx-callback/globals"
"github.com/astaxie/beego"
)
@@ -12,23 +18,13 @@ type TongLianController struct {
func (c *TongLianController) Msg() {
if c.Ctx.Input.Method() == http.MethodPost {
// msg, callbackResponse := api.TLpayAPI.GetCallbackMsg(c.Ctx.Request)
// globals.SugarLogger.Debugf("tonglianapi callback msg:%s, callbackResponse:%s, %t", utils.Format4Output(msg, true), utils.Format4Output(callbackResponse, true), callbackResponse == nil)
// var err error
// if callbackResponse == nil {
// if msg.MsgType == wxpayapi.MsgTypeUnkown {
// err = fmt.Errorf("未知的通联宝支付回调类型:%d", msg.MsgType)
// } else {
// err = localjx.OnTLPayCallback(msg)
// }
// }
// if callbackResponse == nil {
// callbackResponse = wxpayapi.SuccessResponse
// } else if err != nil {
// callbackResponse = wxpayapi.Err2CallbackResponse(err, "")
// }
// c.Data["json"] = callbackResponse
// c.ServeJSON()
call, err := api.TLpayAPI.GetCallbackMsg(c.Ctx.Request)
globals.SugarLogger.Debugf("tonglianapi callback callbackResponse:%s", utils.Format4Output(call, true))
if err == nil {
err = localjx.OnTLPayCallback(call)
}
c.Data["json"] = call
c.ServeJSON()
} else {
c.Abort("404")
}