智慧食堂
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
754 B

  1. package hdl
  2. import (
  3. "applet/app/customer/md"
  4. "applet/app/customer/svc"
  5. "applet/app/e"
  6. "fmt"
  7. "github.com/gin-gonic/gin"
  8. )
  9. func AlipayJsApiCallBack(c *gin.Context) {
  10. data := svc.CheckAllCallbackParams(c)
  11. if data == nil {
  12. e.OutErr(c, e.ERR_INVALID_ARGS)
  13. return
  14. }
  15. c.Set("callback", data)
  16. args, ok := data.(*md.AliPayCallback)
  17. if !ok {
  18. fmt.Println("反射ok失败")
  19. e.OutErr(c, e.ERR_INVALID_ARGS, "反射失败")
  20. return
  21. }
  22. _, err := svc.DealCentralKitchenForSchoolOrderCallBack(args.OutTradeNo, args.TradeStatus)
  23. if err != nil {
  24. e.OutErr(c, e.ERR, err.Error())
  25. return
  26. }
  27. //TODO::此处需要直接输出 success,避免支付宝重复回调
  28. //c.Header("Content-Type", "text/html; charset=utf-8")
  29. c.String(200, "success")
  30. }