mirror of
https://github.com/linux-do/new-api.git
synced 2025-09-19 17:06:38 +08:00
fix epay bug
This commit is contained in:
parent
a10f7cfbe1
commit
381c354313
@ -64,11 +64,13 @@ func RequestEpay(c *gin.Context) {
|
||||
user, _ := model.GetUserById(id, false)
|
||||
amount := GetAmount(float64(req.Amount), *user)
|
||||
|
||||
var payType epay.PurchaseType
|
||||
if req.PaymentMethod == "zfb" {
|
||||
req.PaymentMethod = "alipay"
|
||||
payType = epay.Alipay
|
||||
}
|
||||
if req.PaymentMethod == "wx" {
|
||||
req.PaymentMethod = "wxpay"
|
||||
payType = epay.WechatPay
|
||||
}
|
||||
|
||||
returnUrl, _ := url.Parse(common.ServerAddress + "/log")
|
||||
@ -81,7 +83,7 @@ func RequestEpay(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
uri, params, err := client.Purchase(&epay.PurchaseArgs{
|
||||
Type: epay.PurchaseType(req.PaymentMethod),
|
||||
Type: payType,
|
||||
ServiceTradeNo: "A" + tradeNo,
|
||||
Name: "B" + tradeNo,
|
||||
Money: strconv.FormatFloat(payMoney, 'f', 2, 64),
|
||||
|
Loading…
Reference in New Issue
Block a user