跳转到支付二维码页面

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

@@ -192,6 +192,11 @@ public class RentalTopups {
require(expires != null, "支付有效期缺失");
String checkout = input(created, "url", 1024);
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
&& checkoutUri.getUserInfo() == null, "支付收银台需使用HTTPS");
tx.execute(status -> {
@@ -202,6 +207,9 @@ public class RentalTopups {
return null;
});
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";
Map<String, Object> result = payment.call(order, "query");