feat: 优化充值订单号

This commit is contained in:
CalciumIon 2024-08-03 01:28:18 +08:00
parent e504665f68
commit 88ba8a840e
2 changed files with 5 additions and 5 deletions

View File

@ -101,8 +101,8 @@ func RequestEpay(c *gin.Context) {
}
uri, params, err := client.Purchase(&epay.PurchaseArgs{
Type: payType,
ServiceTradeNo: "A" + tradeNo,
Name: "B" + tradeNo,
ServiceTradeNo: fmt.Sprintf("USR%d-%s", id, tradeNo),
Name: fmt.Sprintf("TUC%d", req.Amount),
Money: strconv.FormatFloat(payMoney, 'f', 2, 64),
Device: epay.PC,
NotifyUrl: notifyUrl,

View File

@ -791,11 +791,11 @@ type topUpRequest struct {
Key string `json:"key"`
}
var lock = sync.Mutex{}
var topUpLock = sync.Mutex{}
func TopUp(c *gin.Context) {
lock.Lock()
defer lock.Unlock()
topUpLock.Lock()
defer topUpLock.Unlock()
req := topUpRequest{}
err := c.ShouldBindJSON(&req)
if err != nil {