提现城市分成比例

This commit is contained in:
苏尹岚
2020-11-11 10:17:22 +08:00
parent 97f9e44e8a
commit cd156feba9
4 changed files with 26 additions and 11 deletions

View File

@@ -21,8 +21,6 @@ import (
)
const (
CashPercentage = 90
sigKey = "sign"
sigTypeMd5 = "MD5"
sigTypeSha256 = "HMAC-SHA256"
@@ -132,11 +130,15 @@ func (p *PayHandler) CreateRefund() (err error) {
Desc: "冲天猴儿app提现到账",
SpbillCreateIP: p.Ctx.GetRealRemoteIP(),
}
//1元以下免费以上收取10%手续费
//1元以下免费以上收取对应城市手续费
place, err := dao.GetPlaceByCode(dao.GetDB(), p.Order.CityCode)
if err != nil || place == nil {
return fmt.Errorf("未找到该城市code%v", p.Order.CityCode)
}
if p.Order.PayPrice < 100 {
param.Amount = p.Order.PayPrice
} else {
param.Amount = p.Order.PayPrice * CashPercentage / 100 //手续费10%
param.Amount = p.Order.PayPrice * place.DividePercentage / 100 //手续费10%
}
if authInfo, err := p.Ctx.GetV2AuthInfo(); err == nil && authInfo.GetAuthType() == weixin.AuthTypeWxApp {
param.OpenID = authInfo.GetAuthID()