1
This commit is contained in:
@@ -2,6 +2,8 @@ package controllers
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"git.rosy.net.cn/baseapi/platformapi/tonglianpayapi"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
|
||||
@@ -29,6 +31,25 @@ func (c *TongLianController) Msg() {
|
||||
}
|
||||
}
|
||||
|
||||
//通联同一扫码支付回调接口
|
||||
func (c *TongLianController) OnLinePay() {
|
||||
globals.SugarLogger.Debug("-------method:= %s", c.Ctx.Input.Method())
|
||||
if c.Ctx.Input.Method() == http.MethodPost {
|
||||
call, err := api.TLpayAPI.GetCallbackOnlinePayMsg(getUsefulRequest2(c.Ctx))
|
||||
if err == nil {
|
||||
err = localjx.OnTLOnlinePayCallback(call)
|
||||
}
|
||||
if err == nil {
|
||||
c.Data["json"] = tonglianpayapi.OnlinePayStatusSuccess
|
||||
} else {
|
||||
c.Data["json"] = tonglianpayapi.OnlinePayStatusFail
|
||||
}
|
||||
c.ServeJSON()
|
||||
} else {
|
||||
c.Abort("404")
|
||||
}
|
||||
}
|
||||
|
||||
func getUsefulRequest2(ctx *context.Context) *http.Request {
|
||||
ctx.Request.Body = ioutil.NopCloser(bytes.NewReader(ctx.Input.RequestBody))
|
||||
return ctx.Request
|
||||
|
||||
Reference in New Issue
Block a user