|
- package hdl
-
- import (
- "applet/app/customer/md"
- "applet/app/customer/svc"
- "applet/app/e"
- "fmt"
- "github.com/gin-gonic/gin"
- )
-
- func AlipayJsApiCallBack(c *gin.Context) {
- data := svc.CheckAllCallbackParams(c)
- if data == nil {
- e.OutErr(c, e.ERR_INVALID_ARGS)
- return
- }
- c.Set("callback", data)
- args, ok := data.(*md.AliPayCallback)
- if !ok {
- fmt.Println("反射ok失败")
- e.OutErr(c, e.ERR_INVALID_ARGS, "反射失败")
- return
- }
- if args.GmtRefund != "" {
- //TODO::退款通知不需要处理
- c.String(200, "success")
- return
- }
- _, err := svc.DealCentralKitchenForSchoolOrderCallBack(args.OutTradeNo, args.TradeStatus)
- if err != nil {
- e.OutErr(c, e.ERR, err.Error())
- return
- }
- //TODO::此处需要直接输出 success,避免支付宝重复回调
- //c.Header("Content-Type", "text/html; charset=utf-8")
- c.String(200, "success")
- }
|