跳转到支付二维码页面

This commit is contained in:
lu7213 committed 2026-10-29 06:39:48 -04:00
1 parent 98533d8c24
commit ac682a28c2
2 files changed
+9

No files matched your search

+1
View File
@@ -104,6 +104,7 @@ RENT_PAYMENT_MAINNET_TLS_CERTIFICATE=file:/etc/nginx/certs/fullchain.pem
- `PAYMENT_RECONCILE`:补偿租约申请等失败,包括旧表缺少 `lease_token` 字段。 - `PAYMENT_RECONCILE`:补偿租约申请等失败,包括旧表缺少 `lease_token` 字段。
- `PAYMENT_CREATE` / `PAYMENT_QUERY`:支付连接、TLS、认证、解析失败;结合支付 HTTP 状态和 businessCode 检查。 - `PAYMENT_CREATE` / `PAYMENT_QUERY`:支付连接、TLS、认证、解析失败;结合支付 HTTP 状态和 businessCode 检查。
若定位到支付响应校验,搜索「充值支付业务失败」:包含HTTP状态、businessCode、dataType、safeMessage及响应字符数。safeMessage只允许项目已知固定错误,未知消息显示UNKNOWN_MESSAGE_REDACTED,避免响应中的SQL或认证信息进入日志。JSON解析失败单独输出安全异常位置,不输出响应正文。 若定位到支付响应校验,搜索「充值支付业务失败」:包含HTTP状态、businessCode、dataType、safeMessage及响应字符数。safeMessage只允许项目已知固定错误,未知消息显示UNKNOWN_MESSAGE_REDACTED,避免响应中的SQL或认证信息进入日志。JSON解析失败单独输出安全异常位置,不输出响应正文。
若支付订单已生成但未跳转,搜索「充值支付跳转校验」「充值支付链接已保存」,核对HTTPS、tradeId、有无未来有效期以及本地状态。浏览器充值详情会明确提示链接无效或有效期异常;创建成功后的跳转优先于二维码和列表刷新,避免展示异常影响付款。有效期兼容毫秒时间戳和ISO日期。旧记录中已经保存的错误域名不会随新配置自动改写,需要核对记录来源后处理,不可将支付URL指向仍为占位符的“你的前端域名”。
- `PAYMENT_CREATE_RESPONSE_VALIDATE`:支付返回单号、金额、地址、有效期或收银台地址不符合要求。 - `PAYMENT_CREATE_RESPONSE_VALIDATE`:支付返回单号、金额、地址、有效期或收银台地址不符合要求。
- `CHAIN_VERIFY` / `LEDGER_CREDIT`:链上核验或账务事务失败。 - `CHAIN_VERIFY` / `LEDGER_CREDIT`:链上核验或账务事务失败。
@@ -192,6 +192,11 @@ public class RentalTopups {
require(expires != null, "支付有效期缺失"); require(expires != null, "支付有效期缺失");
String checkout = input(created, "url", 1024); String checkout = input(created, "url", 1024);
URI checkoutUri = URI.create(checkout); URI checkoutUri = URI.create(checkout);
LOG.info("充值支付跳转校验 orderId={} https={} hostPresent={} userInfoPresent={} tradeIdPresent={} expiryInFuture={}",
id, "https".equalsIgnoreCase(checkoutUri.getScheme()), checkoutUri.getHost() != null,
checkoutUri.getUserInfo() != null,
org.springframework.web.util.UriComponentsBuilder.fromUri(checkoutUri).build().getQueryParams().containsKey("tradeId"),
expires != null && expires.getTime() > System.currentTimeMillis());
require("https".equalsIgnoreCase(checkoutUri.getScheme()) && checkoutUri.getHost() != null require("https".equalsIgnoreCase(checkoutUri.getScheme()) && checkoutUri.getHost() != null
&& checkoutUri.getUserInfo() == null, "支付收银台需使用HTTPS"); && checkoutUri.getUserInfo() == null, "支付收银台需使用HTTPS");
tx.execute(status -> { tx.execute(status -> {
@@ -202,6 +207,9 @@ public class RentalTopups {
return null; return null;
}); });
order = store.get("topup_order", id, false); order = store.get("topup_order", id, false);
LOG.info("充值支付链接已保存 orderId={} status={} checkoutConfigured={} expiryInFuture={}",
id, text(order, "status"), !text(order, "checkout_url").isEmpty(),
time(order.get("expires_at")).toEpochMilli() > System.currentTimeMillis());
} }
stage = "PAYMENT_QUERY"; stage = "PAYMENT_QUERY";
Map<String, Object> result = payment.call(order, "query"); Map<String, Object> result = payment.call(order, "query");