支付模块
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

24 行
681 B

  1. package pay
  2. import (
  3. "code.fnuoos.com/go_rely_warehouse/zyos_go_pay.git/db"
  4. "code.fnuoos.com/go_rely_warehouse/zyos_go_pay.git/db/model"
  5. "errors"
  6. )
  7. func JudgePayChannel(mid, paySceneIdentifier string) (model.PayChannel, error) {
  8. var payChannelMaster = model.PayChannelMaster{}
  9. var payChannel = model.PayChannel{}
  10. res, err := db.Db.Where("app_id = ?", mid).And("identifier = ?", paySceneIdentifier).Get(&payChannelMaster)
  11. if err != nil {
  12. return payChannel, err
  13. }
  14. if !res {
  15. return payChannel, errors.New("查询数据失败")
  16. }
  17. if payChannelMaster.ChannelId == 0 {
  18. return payChannel, errors.New("请联系服务商绑定支付渠道")
  19. }
  20. return payChannel, nil
  21. }