MCPcopy Create free account
hub / github.com/aiprodcoder/MIXAPI / getPayMoney

Function getPayMoney

controller/topup.go:46–65  ·  view source on GitHub ↗
(amount int64, group string)

Source from the content-addressed store, hash-verified

44}
45
46func getPayMoney(amount int64, group string) float64 {
47 dAmount := decimal.NewFromInt(amount)
48
49 if !common.DisplayInCurrencyEnabled {
50 dQuotaPerUnit := decimal.NewFromFloat(common.QuotaPerUnit)
51 dAmount = dAmount.Div(dQuotaPerUnit)
52 }
53
54 topupGroupRatio := common.GetTopupGroupRatio(group)
55 if topupGroupRatio == 0 {
56 topupGroupRatio = 1
57 }
58
59 dTopupGroupRatio := decimal.NewFromFloat(topupGroupRatio)
60 dPrice := decimal.NewFromFloat(setting.Price)
61
62 payMoney := dAmount.Mul(dPrice).Mul(dTopupGroupRatio)
63
64 return payMoney.InexactFloat64()
65}
66
67func getMinTopup() int64 {
68 minTopup := setting.MinTopUp

Callers 2

RequestEpayFunction · 0.85
RequestAmountFunction · 0.85

Calls 1

GetTopupGroupRatioFunction · 0.92

Tested by

no test coverage detected