附近小店
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

29 lines
585 B

  1. package hdl
  2. import (
  3. "applet/app/e"
  4. "applet/app/svc"
  5. "applet/app/utils/logx"
  6. "errors"
  7. "github.com/gin-gonic/gin"
  8. )
  9. // 整合所有支付回调
  10. func PayCallback(c *gin.Context) {
  11. // 统一处理回调参数
  12. data, orderType, payMethod := svc.CheckAllCallbackParams(c)
  13. if data == nil {
  14. e.OutErr(c, e.ERR_INVALID_ARGS)
  15. return
  16. }
  17. c.Set("callback", data)
  18. payCallbackFunc, ok := svc.PayCallbackFuncList[orderType][payMethod]
  19. if !ok || payCallbackFunc == nil {
  20. _ = logx.Warn(errors.New("回调不存在"))
  21. return
  22. }
  23. payCallbackFunc(c)
  24. c.String(200, "success")
  25. return
  26. }