租赁资金账户资金充值功能,对接项目的支付接口,application-rental.yml添加配置NILE和主网的对接配置

This commit is contained in:
lu7213 committed 2026-10-29 02:16:04 -04:00
1 parent 911a3634ee
commit e73f099734
20 files changed
+878 -9

No files matched your search

@@ -40,12 +40,12 @@ public class TronPaymentTask {
@Scheduled(fixedDelay = 10000L)
public void scan() {
ITronService tron;
ITronService tron = null;
try {
tron = tronServiceProvider.getCurrentService();
} catch (RuntimeException e) {
log.warn("无法读取 TRON 全局网络配置,跳过本轮支付扫描:{}", e.getMessage());
return;
log.warn("无法读取 TRON 全局网络配置,仅跳过未保存网络的历史订单扫描:{}", e.getMessage());
// 新订单自带网络,不因旧全局配置缺失阻断新支付订单。
}
for (UsdtOrdersPlus order : orders.list(new LambdaQueryWrapper<UsdtOrdersPlus>()
.eq(UsdtOrdersPlus::getStatus, 1)
@@ -53,8 +53,11 @@ public class TronPaymentTask {
.or().eq(UsdtOrdersPlus::getBlockTransactionId, "")))) {
if (order.getToken() == null || order.getActualAmount() == null) continue;
try {
ITronService orderTron = order.getPaymentNetwork() == null ? tron
: tronServiceProvider.getServiceForNetwork(order.getPaymentNetwork());
if (orderTron == null) continue;
JSONArray data = chainDataClient.queryConfirmedTrc20Transactions(
tron, order.getToken(), 200);
orderTron, order.getToken(), 200);
for (int i = 0; i < data.size(); i++) {
JSONObject tx = data.getJSONObject(i);
if (!order.getToken().equals(tx.getString("to"))) continue;
@@ -81,7 +84,7 @@ public class TronPaymentTask {
} catch (Exception e) {
// 单笔订单查询失败不能中断其他订单,日志中禁止输出凭证和钱包私钥。
log.error(e.getMessage(), e);
log.warn("查询 TRON 支付交易失败,订单ID={},网络={}", order.getId(), tron.type());
log.warn("查询 TRON 支付交易失败,订单ID={},网络={}", order.getId(), order.getPaymentNetwork());
}
}
}
@@ -5,6 +5,30 @@ rental:
master-key: ${RENT_MASTER_KEY:ZA+5tLy20rbLxsMEvVm7Ow9hl2qtAPD3nmiK1Tf52NA=}
master-key-version: ${RENT_MASTER_KEY_VERSION:v1}
confirmations: ${RENT_CONFIRMATIONS:19}
payment:
# 新增表见sql/rent_topup_init.sql;支付库先执行sql/payment_topup_upgrade.sql。
enabled: ${RENT_PAYMENT_ENABLED:false}
connect-timeout-ms: ${RENT_PAYMENT_CONNECT_TIMEOUT_MS:5000}
read-timeout-ms: ${RENT_PAYMENT_READ_TIMEOUT_MS:15000}
reconcile-interval-ms: ${RENT_PAYMENT_RECONCILE_MS:15000}
nile:
enabled: ${RENT_PAYMENT_NILE_ENABLED:false}
base-url: ${RENT_PAYMENT_NILE_BASE_URL:}
api-key: ${RENT_PAYMENT_NILE_API_KEY:}
api-secret: ${RENT_PAYMENT_NILE_API_SECRET:}
rsa-public-key-location: ${RENT_PAYMENT_NILE_PUBLIC_KEY:}
notify-url: ${RENT_PAYMENT_NILE_NOTIFY_URL:}
min-amount: ${RENT_PAYMENT_NILE_MIN_AMOUNT:1.00}
max-amount: ${RENT_PAYMENT_NILE_MAX_AMOUNT:10000.00}
mainnet:
enabled: ${RENT_PAYMENT_MAINNET_ENABLED:false}
base-url: ${RENT_PAYMENT_MAINNET_BASE_URL:}
api-key: ${RENT_PAYMENT_MAINNET_API_KEY:}
api-secret: ${RENT_PAYMENT_MAINNET_API_SECRET:}
rsa-public-key-location: ${RENT_PAYMENT_MAINNET_PUBLIC_KEY:}
notify-url: ${RENT_PAYMENT_MAINNET_NOTIFY_URL:}
min-amount: ${RENT_PAYMENT_MAINNET_MIN_AMOUNT:1.00}
max-amount: ${RENT_PAYMENT_MAINNET_MAX_AMOUNT:10000.00}
rpc:
nile: ${RENT_NILE_RPC:https://nile.trongrid.io}
mainnet: ${RENT_MAINNET_RPC:https://api.trongrid.io}