通联宝支付回调
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
package controllers
|
package controllers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"git.rosy.net.cn/jx-callback/globals/api"
|
"git.rosy.net.cn/jx-callback/globals/api"
|
||||||
@@ -10,6 +12,7 @@ import (
|
|||||||
"git.rosy.net.cn/jx-callback/globals"
|
"git.rosy.net.cn/jx-callback/globals"
|
||||||
|
|
||||||
"github.com/astaxie/beego"
|
"github.com/astaxie/beego"
|
||||||
|
"github.com/astaxie/beego/context"
|
||||||
)
|
)
|
||||||
|
|
||||||
type TongLianController struct {
|
type TongLianController struct {
|
||||||
@@ -18,7 +21,7 @@ type TongLianController struct {
|
|||||||
|
|
||||||
func (c *TongLianController) Msg() {
|
func (c *TongLianController) Msg() {
|
||||||
if c.Ctx.Input.Method() == http.MethodPost {
|
if c.Ctx.Input.Method() == http.MethodPost {
|
||||||
call, err := api.TLpayAPI.GetCallbackMsg(c.Ctx.Request)
|
call, err := api.TLpayAPI.GetCallbackMsg(getUsefulRequest2(c.Ctx))
|
||||||
globals.SugarLogger.Debugf("tonglianapi callback callbackResponse:%s", utils.Format4Output(call, true))
|
globals.SugarLogger.Debugf("tonglianapi callback callbackResponse:%s", utils.Format4Output(call, true))
|
||||||
if err == nil {
|
if err == nil {
|
||||||
err = localjx.OnTLPayCallback(call)
|
err = localjx.OnTLPayCallback(call)
|
||||||
@@ -29,3 +32,8 @@ func (c *TongLianController) Msg() {
|
|||||||
c.Abort("404")
|
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