2025-09-12 19:11:17 +08:00
|
|
|
|
/**
|
|
|
|
|
|
此文件为旧版支付设置文件,如需增加新的参数、变量等,请在 payment_setting.go 中添加
|
|
|
|
|
|
This file is the old version of the payment settings file. If you need to add new parameters, variables, etc., please add them in payment_setting.go
|
|
|
|
|
|
*/
|
2024-04-18 17:52:18 +08:00
|
|
|
|
|
2025-09-12 19:11:17 +08:00
|
|
|
|
package operation_setting
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
2025-10-11 15:30:09 +08:00
|
|
|
|
"github.com/QuantumNous/new-api/common"
|
2025-09-12 19:11:17 +08:00
|
|
|
|
)
|
2025-06-18 21:23:06 +08:00
|
|
|
|
|
2024-04-18 17:52:18 +08:00
|
|
|
|
var PayAddress = ""
|
|
|
|
|
|
var CustomCallbackAddress = ""
|
|
|
|
|
|
var EpayId = ""
|
|
|
|
|
|
var EpayKey = ""
|
|
|
|
|
|
var Price = 7.3
|
|
|
|
|
|
var MinTopUp = 1
|
2025-07-17 23:04:45 +08:00
|
|
|
|
var USDExchangeRate = 7.3
|
2025-06-18 21:23:06 +08:00
|
|
|
|
|
|
|
|
|
|
var PayMethods = []map[string]string{
|
|
|
|
|
|
{
|
|
|
|
|
|
"name": "支付宝",
|
|
|
|
|
|
"color": "rgba(var(--semi-blue-5), 1)",
|
2025-06-20 17:48:55 +08:00
|
|
|
|
"type": "alipay",
|
2025-06-18 21:23:06 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
"name": "微信",
|
|
|
|
|
|
"color": "rgba(var(--semi-green-5), 1)",
|
2025-06-20 17:48:55 +08:00
|
|
|
|
"type": "wxpay",
|
2025-06-18 21:23:06 +08:00
|
|
|
|
},
|
2025-09-12 19:11:17 +08:00
|
|
|
|
{
|
|
|
|
|
|
"name": "自定义1",
|
|
|
|
|
|
"color": "black",
|
|
|
|
|
|
"type": "custom1",
|
|
|
|
|
|
"min_topup": "50",
|
|
|
|
|
|
},
|
2025-06-18 21:23:06 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func UpdatePayMethodsByJsonString(jsonString string) error {
|
|
|
|
|
|
PayMethods = make([]map[string]string, 0)
|
2025-09-12 19:11:17 +08:00
|
|
|
|
return common.Unmarshal([]byte(jsonString), &PayMethods)
|
2025-06-18 21:23:06 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func PayMethods2JsonString() string {
|
2025-09-12 19:11:17 +08:00
|
|
|
|
jsonBytes, err := common.Marshal(PayMethods)
|
2025-06-18 21:23:06 +08:00
|
|
|
|
if err != nil {
|
|
|
|
|
|
return "[]"
|
|
|
|
|
|
}
|
|
|
|
|
|
return string(jsonBytes)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func ContainsPayMethod(method string) bool {
|
|
|
|
|
|
for _, payMethod := range PayMethods {
|
|
|
|
|
|
if payMethod["type"] == method {
|
|
|
|
|
|
return true
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
return false
|
|
|
|
|
|
}
|