Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
94ba4b7c5b | ||
|
|
14644e00a5 | ||
|
|
be2ef02923 | ||
|
|
6ccd93a161 |
@@ -64,7 +64,7 @@ docker run -d --restart=unless-stopped -p 8080:8080 v03413/bepusdt:latest
|
||||
|
||||
- 安装:[Docker](docs/docker/docker.md) [Linux](docs/linux/install.md) [1Panel](./docs/1panel/README.md) [宝塔](./docs/bt_panel/README.md)
|
||||
- 开发:[API对接](docs/api/api.md) [订单回调](docs/notify/readme.md) [Python](https://github.com/luoyanglang/bepusdt-python-sdk) [PHP](https://github.com/v03413/bepusdt-php-sdk)
|
||||
- 对接:[独角数卡](docs/api/dujiaoka/dujiaoka.md) [彩虹易支付](https://github.com/v03413/Epay-BEpusdt) [whmcs](https://github.com/v03413/whmcs-gateway-epusdt) [其它](docs/api/other.md)
|
||||
- 对接:[独角Next](docs/api/dujiao-next/dujiao-next.md) [彩虹易支付](https://github.com/v03413/Epay-BEpusdt) [whmcs](https://github.com/v03413/whmcs-gateway-epusdt) [其它](docs/api/other.md)
|
||||
- 其它:[https 配置](./docs/ssl.md) [时钟同步](docs/linux/systemd-timesyncd.md) [收银台修改](docs/payment-template/README.md)
|
||||
|
||||
## 🖼 功能截图
|
||||
@@ -94,7 +94,7 @@ docker run -d --restart=unless-stopped -p 8080:8080 v03413/bepusdt:latest
|
||||
|
||||
## 🙏 致谢
|
||||
|
||||
- [Epusdt](https://github.com/assimon/epusdt)
|
||||
- [EPusdt](./docs/faq/epusdt.md)
|
||||
|
||||
## 🌟 Star 历史
|
||||
|
||||
|
||||
+59
-36
@@ -15,6 +15,37 @@ import (
|
||||
)
|
||||
|
||||
var confCache sync.Map
|
||||
var defaultConf = map[ConfKey]string{
|
||||
ApiAppUri: "",
|
||||
RateSyncInterval: "3600",
|
||||
AtomUSDT: "0.01",
|
||||
AtomUSDC: "0.01",
|
||||
AtomTRX: "0.01",
|
||||
AtomBNB: "0.00001",
|
||||
AtomETH: "0.000001",
|
||||
MonitorMinAmount: "0.01",
|
||||
PaymentMinAmount: "0.01",
|
||||
PaymentMaxAmount: "99999",
|
||||
RpcEndpointTron: "grpc.trongrid.io:50051",
|
||||
RpcEndpointBsc: "https://binance-smart-chain-public.nodies.app/",
|
||||
RpcEndpointSolana: "https://solana-rpc.publicnode.com/",
|
||||
RpcEndpointXlayer: "https://xlayerrpc.okx.com/",
|
||||
RpcEndpointPolygon: "https://polygon-public.nodies.app/",
|
||||
RpcEndpointArbitrum: "https://arb1.arbitrum.io/rpc",
|
||||
RpcEndpointEthereum: "https://ethereum-public.nodies.app/",
|
||||
RpcEndpointBase: "https://base-public.nodies.app/",
|
||||
RpcEndpointAptos: "https://aptos-rest.publicnode.com/",
|
||||
RpcEndpointPlasma: "https://rpc.plasma.to/",
|
||||
NotifyMaxRetry: "10",
|
||||
BlockHeightMaxDiff: "1000",
|
||||
BlockOffsetConfirm: "0",
|
||||
PaymentTimeout: "1200", // 20分钟
|
||||
PaymentMatchMode: string(Classic),
|
||||
SystemInstallLock: "0",
|
||||
RateSyncCoingeckoApiUrl: "https://api.coingecko.com",
|
||||
RateSyncHistoryDays: "30",
|
||||
MqttTopicPrefix: "bepusdt",
|
||||
}
|
||||
|
||||
type Conf struct {
|
||||
K ConfKey `gorm:"column:k;type:varchar(32);not null;primaryKey" json:"key"`
|
||||
@@ -122,47 +153,19 @@ func ConfInit() {
|
||||
var password = hash[20:30]
|
||||
var encrypt, _ = bcrypt.GenerateFromPassword([]byte(password), bcrypt.DefaultCost)
|
||||
var data = map[ConfKey]string{
|
||||
ApiAppUri: "",
|
||||
ApiAuthToken: token,
|
||||
AdminSecret: utils.StrSha256(hash),
|
||||
AdminSecure: secure,
|
||||
AdminUsername: username,
|
||||
AdminPassword: string(encrypt),
|
||||
RateSyncInterval: "3600",
|
||||
AtomUSDT: "0.01",
|
||||
AtomUSDC: "0.01",
|
||||
AtomTRX: "0.01",
|
||||
AtomBNB: "0.00001",
|
||||
AtomETH: "0.000001",
|
||||
MonitorMinAmount: "0.01",
|
||||
PaymentMinAmount: "0.01",
|
||||
PaymentMaxAmount: "99999",
|
||||
RpcEndpointTron: "grpc.trongrid.io:50051",
|
||||
RpcEndpointBsc: "https://binance-smart-chain-public.nodies.app/",
|
||||
RpcEndpointSolana: "https://solana-rpc.publicnode.com/",
|
||||
RpcEndpointXlayer: "https://xlayerrpc.okx.com/",
|
||||
RpcEndpointPolygon: "https://polygon-public.nodies.app/",
|
||||
RpcEndpointArbitrum: "https://arb1.arbitrum.io/rpc",
|
||||
RpcEndpointEthereum: "https://ethereum-public.nodies.app/",
|
||||
RpcEndpointBase: "https://base-public.nodies.app/",
|
||||
RpcEndpointAptos: "https://aptos-rest.publicnode.com/",
|
||||
RpcEndpointPlasma: "https://rpc.plasma.to/",
|
||||
NotifyMaxRetry: "10",
|
||||
BlockHeightMaxDiff: "1000",
|
||||
BlockOffsetConfirm: "0",
|
||||
PaymentTimeout: "1200", // 20分钟
|
||||
PaymentStaticPath: "",
|
||||
PaymentMatchMode: string(Classic),
|
||||
SystemInstallLock: "0",
|
||||
RateSyncCoingeckoApiUrl: "https://api.coingecko.com",
|
||||
RateSyncCoingeckoApiKey: "",
|
||||
MqttTopicPrefix: "bepusdt",
|
||||
ApiAuthToken: token,
|
||||
AdminSecret: utils.StrSha256(hash),
|
||||
AdminSecure: secure,
|
||||
AdminUsername: username,
|
||||
AdminPassword: string(encrypt),
|
||||
}
|
||||
|
||||
var rows = make([]Conf, 0)
|
||||
for k, v := range data {
|
||||
rows = append(rows, Conf{K: k, V: v})
|
||||
}
|
||||
for k, v := range defaultConf {
|
||||
rows = append(rows, Conf{K: k, V: v})
|
||||
}
|
||||
|
||||
fmt.Println()
|
||||
fmt.Println("╔═══════════════════════════════════════════════════════════════════════")
|
||||
@@ -226,3 +229,23 @@ func GetInstallInfo() gin.H {
|
||||
func GetTronGridApiKeys() []string {
|
||||
return strings.Split(GetK(RpcEndpointTronGridApiKey), ",")
|
||||
}
|
||||
|
||||
func FillDefaultConf() {
|
||||
var existKeys []string
|
||||
Db.Model(&Conf{}).Pluck("k", &existKeys)
|
||||
|
||||
existSet := make(map[ConfKey]struct{}, len(existKeys))
|
||||
for _, k := range existKeys {
|
||||
existSet[ConfKey(k)] = struct{}{}
|
||||
}
|
||||
|
||||
var rows []Conf
|
||||
for k, v := range defaultConf {
|
||||
if _, ok := existSet[k]; !ok {
|
||||
rows = append(rows, Conf{K: k, V: v})
|
||||
}
|
||||
}
|
||||
if len(rows) > 0 {
|
||||
Db.Create(&rows)
|
||||
}
|
||||
}
|
||||
|
||||
+5
-3
@@ -66,9 +66,11 @@ const (
|
||||
RateSyncCoingeckoApiUrl ConfKey = "rate_sync_coingecko_api_url" // 汇率同步 Coingecko Api URL
|
||||
RateSyncCoingeckoApiKey ConfKey = "rate_sync_coingecko_api_key" // 汇率同步 Coingecko Api Key
|
||||
RateSyncInterval ConfKey = "rate_sync_interval" // 汇率同步间隔,单位秒
|
||||
NotifyMaxRetry ConfKey = "notify_max_retry" // 最大重试次数,订单回调失败
|
||||
BlockHeightMaxDiff ConfKey = "block_height_max_diff" // 区块高度最大差值,超过此值则以当前区块高度为准,重新开始扫描
|
||||
BlockOffsetConfirm ConfKey = "block_offset_confirm" // 区块偏移确认数,扫描时以当前区块高度减去此偏移量为准,避免重链导致的订单回调失败
|
||||
RateSyncHistoryDays ConfKey = "rate_sync_history_days" // 历史汇率保存天数
|
||||
|
||||
NotifyMaxRetry ConfKey = "notify_max_retry" // 最大重试次数,订单回调失败
|
||||
BlockHeightMaxDiff ConfKey = "block_height_max_diff" // 区块高度最大差值,超过此值则以当前区块高度为准,重新开始扫描
|
||||
BlockOffsetConfirm ConfKey = "block_offset_confirm" // 区块偏移确认数,扫描时以当前区块高度减去此偏移量为准,避免重链导致的订单回调失败
|
||||
|
||||
MqttHost ConfKey = "mqtt_host"
|
||||
MqttPort ConfKey = "mqtt_port"
|
||||
|
||||
@@ -76,6 +76,7 @@ func initSqlite(path string) error {
|
||||
ConfInit()
|
||||
}
|
||||
|
||||
FillDefaultConf()
|
||||
RefreshC()
|
||||
|
||||
return nil
|
||||
@@ -118,6 +119,7 @@ func initMySQL(dsn string) error {
|
||||
ConfInit()
|
||||
}
|
||||
|
||||
FillDefaultConf()
|
||||
RefreshC()
|
||||
|
||||
return nil
|
||||
@@ -157,6 +159,7 @@ func initPostgres(dsn string) error {
|
||||
ConfInit()
|
||||
}
|
||||
|
||||
FillDefaultConf()
|
||||
RefreshC()
|
||||
|
||||
return nil
|
||||
|
||||
@@ -119,10 +119,6 @@ func BuildOrder(p OrderParams, data Trade) (Order, error) {
|
||||
if tradeOrder.Name == "" {
|
||||
tradeOrder.Name = tradeOrder.OrderId
|
||||
}
|
||||
if tradeOrder.CurrencyLimit == "" {
|
||||
tradeOrder.CurrencyLimit = string(data.Crypto)
|
||||
}
|
||||
|
||||
if err = Db.Create(&tradeOrder).Error; err != nil {
|
||||
log.Error("订单创建失败:", err.Error())
|
||||
return Order{}, err
|
||||
|
||||
+16
-2
@@ -1,6 +1,9 @@
|
||||
package mqtt
|
||||
|
||||
import mqtt "github.com/eclipse/paho.mqtt.golang"
|
||||
import (
|
||||
mqtt "github.com/eclipse/paho.mqtt.golang"
|
||||
"github.com/v03413/bepusdt/app/log"
|
||||
)
|
||||
|
||||
// Publish 发布消息。若 MQTT 未连接则静默丢弃,返回 nil。
|
||||
func Publish(topic string, qos byte, retained bool, payload interface{}) mqtt.Token {
|
||||
@@ -12,5 +15,16 @@ func Publish(topic string, qos byte, retained bool, payload interface{}) mqtt.To
|
||||
return nil
|
||||
}
|
||||
|
||||
return c.Publish(topic, qos, retained, payload)
|
||||
token := c.Publish(topic, qos, retained, payload)
|
||||
if qos > 0 {
|
||||
go func() {
|
||||
token.Wait()
|
||||
if err := token.Error(); err != nil {
|
||||
log.Warn("MQTT publish error: " + err.Error())
|
||||
return
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
return token
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import (
|
||||
func init() {
|
||||
var rate = Rate{}
|
||||
|
||||
Register(Task{Duration: time.Hour, Callback: rate.Clear})
|
||||
Register(Task{Duration: time.Second * 5, Callback: rate.Sync})
|
||||
}
|
||||
|
||||
@@ -34,3 +35,13 @@ func (Rate) Sync(ctx context.Context) {
|
||||
log.Warn(fmt.Sprintf("同步汇率失败: %s", err.Error()))
|
||||
}
|
||||
}
|
||||
|
||||
func (Rate) Clear(ctx context.Context) {
|
||||
days := cast.ToInt(model.GetC(model.RateSyncHistoryDays))
|
||||
if days <= 0 {
|
||||
days = 1
|
||||
}
|
||||
|
||||
createdAt := time.Now().AddDate(0, 0, -days)
|
||||
model.Db.Where("created_at < ?", createdAt).Delete(&model.Rate{})
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 104 KiB |
@@ -1,202 +1,67 @@
|
||||
# Dujiao-Next 对接教程
|
||||
# DuJiao Next 对接 BEpusdt 集成指南
|
||||
|
||||
本文档介绍如何在 [Dujiao-Next](https://github.com/dujiao-next/dujiao-next)(独角next)中对接 BEpusdt。
|
||||
**当前教程针对的是新版独角 [Dujiao Next](https://dujiao-next.com/),旧版独角数卡对接[请看这个](../dujiaoka/dujiaoka.md)**
|
||||
|
||||
## 前置条件
|
||||
## 前提条件
|
||||
|
||||
- BEpusdt 已成功安装并运行
|
||||
- Dujiao-Next 已部署
|
||||
在开始配置前,请确保已满足以下条件:
|
||||
|
||||
**BEpusdt 部署信息**
|
||||
|
||||
- API 服务地址:`https://your-bepusdt.com`
|
||||
- API 密钥:`your_api_token`
|
||||
|
||||
**DuJiao Next 部署信息**
|
||||
|
||||
- 部署地址:`https://your-dujiao.com`
|
||||
- 已进入后台管理界面
|
||||
- 已找到支付渠道管理 > 新增渠道功能
|
||||
|
||||
## 配置步骤
|
||||
|
||||
### 1. 进入支付渠道配置
|
||||
在 DuJiao Next 后台中选择渠道类型为 BEpusdt,按照以下格式进行配置。
|
||||
|
||||
Dujiao-Next 后台 → 支付渠道 → 新增渠道
|
||||

|
||||
|
||||
### 2. 基本参数填写
|
||||
**必填配置项**
|
||||
|
||||
| 参数名称 | 填写内容 | 说明 |
|
||||
|---------|---------|------|
|
||||
| 渠道名称 | USDT-TRC20 支付 | 自定义名称,建议包含币种 |
|
||||
| 渠道类型 | `epusdt` | 固定值,选择 BEpusdt |
|
||||
| 支付方式 | `usdt-trc20` / `usdc-trc20` / `trx` | 选择支持的币种 |
|
||||
| 交互方式 | `qr` 或 `redirect` | 二维码或跳转收银台 |
|
||||
| 配置项 | 说明 | 示例 |
|
||||
|-----------|--------------------|----------------------------------------------------|
|
||||
| 网关地址 | BEpusdt 的 API 服务地址 | `https://your-bepusdt.com` |
|
||||
| API Token | BEpusdt 的 API 密钥 | `your_api_token` |
|
||||
| 支付币种 | 支持的加密资产类型,严格区分大小写 | `usdt.trc20` |
|
||||
| 法币类型 | 支持的法定货币类型 | `CNY`、`USD`、`EUR`、`JPY`、`GBP` |
|
||||
| 异步通知地址 | 交易完成时的服务器异步回调地址 | `https://your-dujiao.com/api/v1/payments/callback` |
|
||||
| 同步回跳地址 | 用户支付完成后的页面跳转地址 | `https://your-dujiao.com/pay` |
|
||||
|
||||
### 3. 支持的渠道类型
|
||||
**配置说明**
|
||||
|
||||
Dujiao-Next 支持以下 BEpusdt 币种:
|
||||
- **支付币种**:详见 [支持的币种列表](https://github.com/v03413/BEpusdt/blob/main/docs/trade-type.md),必须严格区分大小写。
|
||||
- **法币类型**:仅支持 `CNY`、`USD`、`EUR`、`JPY`、`GBP` 五种,必须严格区分大小写。
|
||||
|
||||
| 渠道类型 | 说明 | 对应 trade_type |
|
||||
|---------|------|----------------|
|
||||
| `usdt-trc20` | USDT (TRC20) | `usdt.trc20` |
|
||||
| `usdc-trc20` | USDC (TRC20) | `usdc.trc20` |
|
||||
| `trx` | TRX | `tron.trx` |
|
||||
**⚠️ 重要说明:异步通知地址和同步回跳地址**
|
||||
|
||||
> **注意**:选择渠道类型后,系统会自动设置对应的 `trade_type`,无需手动填写。
|
||||
这两个地址的路由部分 **严格按要求修改**,只需将域名部分替换为您实际部署的 DuJiao Next 服务器地址:
|
||||
|
||||
### 4. 渠道配置参数
|
||||
- **异步通知地址**:`https://your-dujiao.com/api/v1/payments/callback`
|
||||
- 路由固定为 `/api/v1/payments/callback`
|
||||
- 示例:若部署地址为 `https://example.com`,则填写 `https://example.com/api/v1/payments/callback`
|
||||
|
||||
在「渠道配置」中填写以下 JSON:
|
||||
- **同步回跳地址**:`https://your-dujiao.com/pay`
|
||||
- 路由固定为 `/pay`
|
||||
- 示例:若部署地址为 `https://example.com`,则填写 `https://example.com/pay`
|
||||
|
||||
```json
|
||||
{
|
||||
"gateway_url": "https://your-bepusdt-domain.com",
|
||||
"auth_token": "your-api-token",
|
||||
"fiat": "CNY",
|
||||
"notify_url": "https://your-api-domain.com/api/v1/payments/callback",
|
||||
"return_url": "https://your-user-domain.com/pay"
|
||||
}
|
||||
```
|
||||
## 配置验证
|
||||
|
||||
### 5. 配置参数说明
|
||||
配置完成后,请按照以下步骤进行测试:
|
||||
|
||||
| 参数 | 必填 | 说明 | 示例 |
|
||||
|------|------|------|------|
|
||||
| `gateway_url` | ✅ | BEpusdt 网关地址 | `https://pay.example.com` |
|
||||
| `auth_token` | ✅ | BEpusdt API Token | 从 BEpusdt 后台获取 |
|
||||
| `trade_type` | ❌ | 交易类型(自动设置) | `usdt.trc20` / `usdc.trc20` / `tron.trx` |
|
||||
| `fiat` | ❌ | 法币类型,默认 `CNY` | `CNY` / `USD` |
|
||||
| `notify_url` | ✅ | 异步回调地址 | `https://api.example.com/api/v1/payments/callback` |
|
||||
| `return_url` | ✅ | 支付成功跳转地址 | `https://shop.example.com/pay` |
|
||||
1. 进入 DuJiao Next 前台,进行支付测试。
|
||||
2. 观察是否正常跳转到支付页面。
|
||||
|
||||
> **重要提示**:
|
||||
> - `trade_type` 会根据「支付方式」自动设置,无需在配置中填写
|
||||
> - `notify_url` 路径必须是 `/api/v1/payments/callback`(不是 `/api/public/payment/callback`)
|
||||
> - `return_url` 路径必须是 `/pay`(不是 `/order` 或 `/payment`)
|
||||
## 故障排查
|
||||
|
||||
## 获取 API Token
|
||||
若出现网关错误提示,请按照以下步骤排查:
|
||||
|
||||
1. 登录 BEpusdt 后台
|
||||
2. 系统管理 → 基本设置 → API 设置
|
||||
3. 复制「对接令牌」
|
||||
|
||||
## 配置示例
|
||||
|
||||
### 示例 1:USDT-TRC20 支付
|
||||
|
||||
```
|
||||
渠道名称: USDT-TRC20 支付
|
||||
渠道类型: epusdt
|
||||
支付方式: usdt-trc20
|
||||
交互方式: qr
|
||||
|
||||
渠道配置:
|
||||
{
|
||||
"gateway_url": "http://127.0.0.1:8088",
|
||||
"auth_token": "your-token-here",
|
||||
"fiat": "CNY",
|
||||
"notify_url": "https://api.example.com/api/v1/payments/callback",
|
||||
"return_url": "https://shop.example.com/pay"
|
||||
}
|
||||
```
|
||||
|
||||
### 示例 2:TRX 支付
|
||||
|
||||
```
|
||||
渠道名称: TRX 支付
|
||||
渠道类型: epusdt
|
||||
支付方式: trx
|
||||
交互方式: redirect
|
||||
|
||||
渠道配置:
|
||||
{
|
||||
"gateway_url": "http://127.0.0.1:8088",
|
||||
"auth_token": "your-token-here",
|
||||
"fiat": "CNY",
|
||||
"notify_url": "https://api.example.com/api/v1/payments/callback",
|
||||
"return_url": "https://shop.example.com/pay"
|
||||
}
|
||||
```
|
||||
|
||||
## 回调机制说明
|
||||
|
||||
### 异步通知(notify_url)
|
||||
|
||||
BEpusdt 会在支付状态变化时,向 `notify_url` 发送 POST 请求:
|
||||
|
||||
```
|
||||
POST /api/v1/payments/callback
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
|
||||
order_id=xxx&trade_id=xxx&amount=xxx&actual_amount=xxx&token=xxx&...&signature=xxx
|
||||
```
|
||||
|
||||
Dujiao-Next 会验证签名并更新订单状态。
|
||||
|
||||
### 同步跳转(return_url)
|
||||
|
||||
用户支付完成后,BEpusdt 会跳转到 `return_url`,并附带参数:
|
||||
|
||||
```
|
||||
https://shop.example.com/pay?order_id=xxx&epusdt_return=1
|
||||
```
|
||||
|
||||
Dujiao-Next 前端会检测 `epusdt_return=1` 参数,自动查询订单状态并显示支付结果。
|
||||
|
||||
## 常见问题
|
||||
|
||||
### 1. 支付创建失败
|
||||
|
||||
**可能原因**:
|
||||
- `gateway_url` 配置错误或 BEpusdt 服务未运行
|
||||
- `auth_token` 与 BEpusdt 配置不一致
|
||||
- 网络连接问题(检查防火墙)
|
||||
|
||||
**解决方法**:
|
||||
- 检查 BEpusdt 服务状态:`curl http://your-bepusdt/health`
|
||||
- 验证 API Token 是否正确
|
||||
- 查看 Dujiao-Next 后端日志
|
||||
|
||||
### 2. 回调未收到或订单状态未更新
|
||||
|
||||
**可能原因**:
|
||||
- `notify_url` 配置错误(路径必须是 `/api/v1/payments/callback`)
|
||||
- BEpusdt 无法访问回调地址(网络/防火墙问题)
|
||||
- 签名验证失败
|
||||
|
||||
**解决方法**:
|
||||
- 确认回调地址可被外网访问:`curl https://your-api/api/v1/payments/callback`
|
||||
- 检查 BEpusdt 日志中的回调错误
|
||||
- 检查 Dujiao-Next 后端日志中的签名验证信息
|
||||
|
||||
### 3. 支付完成后跳转错误
|
||||
|
||||
**可能原因**:
|
||||
- `return_url` 路径配置错误(必须是 `/pay` 不是 `/payment` 或 `/order`)
|
||||
- 前端路由配置问题
|
||||
|
||||
**解决方法**:
|
||||
- 确认 `return_url` 配置为:`https://your-user-domain.com/pay`
|
||||
- 清除浏览器缓存后重试
|
||||
|
||||
### 4. 签名验证失败
|
||||
|
||||
**可能原因**:
|
||||
- `auth_token` 不一致(注意前后空格)
|
||||
- 回调参数被中间件修改
|
||||
|
||||
**解决方法**:
|
||||
- 确保 `auth_token` 完全一致
|
||||
- 检查是否有反向代理修改了请求参数
|
||||
|
||||
### 5. 金额不匹配
|
||||
|
||||
**可能原因**:
|
||||
- 汇率波动导致实际支付金额与订单金额不同
|
||||
- BEpusdt 配置的汇率源问题
|
||||
|
||||
**解决方法**:
|
||||
- BEpusdt 会返回 `actual_amount`(实际支付金额),Dujiao-Next 会记录此金额
|
||||
- 可在订单详情中查看实际支付金额
|
||||
|
||||
## 技术支持
|
||||
|
||||
- Dujiao-Next: [GitHub Issues](https://github.com/dujiao-next/dujiao-next/issues)
|
||||
- BEpusdt: [Telegram 群组](https://t.me/BEpusdtChat)
|
||||
|
||||
---
|
||||
|
||||
**贡献者**: 狼哥 ([@luoyanglang](https://github.com/luoyanglang) | Telegram: [@luoyanglang](https://t.me/luoyanglang))
|
||||
|
||||
> 本文档适用于 Dujiao-Next 最新版本和 BEpusdt 最新版本
|
||||
> 最后更新:2026-02-13
|
||||
- **检查网络连通性**:确认 DuJiao Next API 所在服务器能够正常访问 BEpusdt API 地址。
|
||||
- **检查 API Token**:确认所配置的 API Token 与 BEpusdt 中的密钥一致。
|
||||
- **查看日志**:检查 DuJiao Next 和 BEpusdt 的应用日志,获取更详细的错误信息。
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
|
||||
以下是常见程序的对接文档,请根据您的实际需求选择相应教程进行配置。如遇问题,请仔细核对操作步骤,或在相关技术社区寻求协助。
|
||||
|
||||
- [独角Dujiao-Next](https://dujiao-next.com/payment/guide#_3-7-bepusdt)
|
||||
- [独角Dujiao-Next](./dujiao-next/dujiao-next.md)
|
||||
- [独角数卡(旧版)](./dujiaoka/dujiaoka.md)
|
||||
- [彩虹易支付](https://github.com/v03413/Epay-BEpusdt)
|
||||
- [WHMCS](https://github.com/v03413/whmcs-gateway-epusdt)
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
# BEpusdt 与 EPusdt 项目说明
|
||||
|
||||
## 项目背景
|
||||
|
||||
### EPusdt
|
||||
|
||||
EPusdt 是与独角数卡(开源数字商品销售系统)配套的个人 USDT 收款网关,两个项目由同一作者
|
||||
@assimon 开发。
|
||||
|
||||
### BEpusdt
|
||||
|
||||
BEpusdt 由独立作者开发;由于 EPusdt 在一段时间内缺乏积极维护,结合个人需求和对区块链技术的兴趣,才开发了 BEpusdt 项目。
|
||||
BEpusdt 项目名称含义:在 EPusdt 前添加字母 `B`(代表 `Better`),寓意更简单、更好用的 USDT 收款网关。
|
||||
|
||||
## 项目演进
|
||||
|
||||
| 时间 | 事件 |
|
||||
|-------------|-----------------------------|
|
||||
| 2022 年 3 月 | EPusdt 项目发布,4 月基本完善,后续基本无更新 |
|
||||
| 2023 年 10 月 | BEpusdt 项目建立,持续迭代更新至今 |
|
||||
| 2026 年 3 月 | EPusdt 项目转让给其他开发者接手维护 |
|
||||
|
||||
## ⚠️ 重要声明
|
||||
|
||||
**BEpusdt 与转让后的 EPusdt 项目没有任何联系、无共同维护者。两个项目完全独立运营。**
|
||||
|
||||
## 致谢
|
||||
|
||||
感谢原作者 [@assimon](https://github.com/assimon) 开源的 EPusdt 项目,为本项目的诞生提供了灵感和参考。
|
||||
@@ -151,6 +151,17 @@
|
||||
<a-input v-model="syncForm.apiKey" placeholder="请输入 API Key(可选)" allow-clear style="width: 100%" />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="汇率保留天数">
|
||||
<a-input-number
|
||||
v-model="syncForm.historyDays"
|
||||
:min="1"
|
||||
:max="365"
|
||||
:precision="0"
|
||||
placeholder="请输入汇率保留天数"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<div class="sync-tip">
|
||||
<a-typography-text type="secondary">
|
||||
<icon-info-circle style="margin-right: 4px" />
|
||||
@@ -487,8 +498,9 @@ const syncFormRef = ref();
|
||||
|
||||
const syncForm = reactive({
|
||||
minutes: 60,
|
||||
apiUrl: "https://api.coingecko.com", // 默认官方接口
|
||||
apiKey: ""
|
||||
apiUrl: "https://api.coingecko.com",
|
||||
apiKey: "",
|
||||
historyDays: 30
|
||||
});
|
||||
|
||||
// API 接口选项
|
||||
@@ -507,11 +519,10 @@ const apiUrlOptions = [
|
||||
const showSyncModal = async () => {
|
||||
try {
|
||||
const res = await getsConfAPI({
|
||||
keys: ["rate_sync_interval", "rate_sync_coingecko_api_url", "rate_sync_coingecko_api_key"]
|
||||
keys: ["rate_sync_interval", "rate_sync_coingecko_api_url", "rate_sync_coingecko_api_key", "rate_sync_history_days"]
|
||||
});
|
||||
|
||||
if (res.data) {
|
||||
// 设置同步频率
|
||||
if (res.data.rate_sync_interval) {
|
||||
const seconds = parseInt(res.data.rate_sync_interval);
|
||||
const minutes = Math.round(seconds / 60);
|
||||
@@ -522,16 +533,19 @@ const showSyncModal = async () => {
|
||||
|
||||
syncForm.apiUrl = res.data.rate_sync_coingecko_api_url || "https://api.coingecko.com";
|
||||
syncForm.apiKey = res.data.rate_sync_coingecko_api_key || "";
|
||||
syncForm.historyDays = res.data.rate_sync_history_days ? parseInt(res.data.rate_sync_history_days) : 30;
|
||||
} else {
|
||||
syncForm.minutes = 60;
|
||||
syncForm.apiUrl = "https://api.coingecko.com";
|
||||
syncForm.apiKey = "";
|
||||
syncForm.historyDays = 30;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("获取同步频率配置失败:", error);
|
||||
syncForm.minutes = 60;
|
||||
syncForm.apiUrl = "https://api.coingecko.com";
|
||||
syncForm.apiKey = "";
|
||||
syncForm.historyDays = 30;
|
||||
Message.warning("获取当前配置失败,使用默认值");
|
||||
}
|
||||
|
||||
@@ -550,13 +564,19 @@ const handleSyncSubmit = async () => {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!syncForm.historyDays || syncForm.historyDays < 1 || syncForm.historyDays > 365) {
|
||||
Message.error("请输入有效的汇率保留天数(1-365天)");
|
||||
return;
|
||||
}
|
||||
|
||||
syncLoading.value = true;
|
||||
const seconds = syncForm.minutes * 60;
|
||||
|
||||
await setsConfAPI([
|
||||
{ key: "rate_sync_interval", value: seconds.toString() },
|
||||
{ key: "rate_sync_coingecko_api_url", value: syncForm.apiUrl },
|
||||
{ key: "rate_sync_coingecko_api_key", value: syncForm.apiKey }
|
||||
{ key: "rate_sync_coingecko_api_key", value: syncForm.apiKey },
|
||||
{ key: "rate_sync_history_days", value: syncForm.historyDays.toString() }
|
||||
]);
|
||||
|
||||
Message.success("汇率同步配置已保存");
|
||||
@@ -575,6 +595,7 @@ const handleSyncCancel = () => {
|
||||
syncForm.minutes = 60;
|
||||
syncForm.apiUrl = "https://api.coingecko.com";
|
||||
syncForm.apiKey = "";
|
||||
syncForm.historyDays = 30;
|
||||
};
|
||||
|
||||
// 支付颗粒度相关状态
|
||||
|
||||
Reference in New Issue
Block a user