租赁资金账户资金充值功能,对接项目的支付接口,application-rental.yml添加配置NILE和主网的对接配置
This commit is contained in:
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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user