From e421f037902ff00a5b56249a5b112260ee331294 Mon Sep 17 00:00:00 2001 From: wangjia <809946525@qq.com> Date: Thu, 9 Jul 2026 16:00:25 +0800 Subject: [PATCH] =?UTF-8?q?fix(pay):=20=E6=B5=8B=E8=AF=95=E9=A1=B5?= =?UTF-8?q?=E5=AF=B9=E9=BD=90=E5=AE=98=E7=BD=91=E6=9A=96=E8=89=B2=E9=A3=8E?= =?UTF-8?q?=E6=A0=BC=20+=20=E4=BF=AE=E5=9C=B0=E5=9D=80=E9=80=90=E5=AD=97?= =?UTF-8?q?=E6=8D=A2=E8=A1=8C=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 布局 bug:收款地址原挤在 flex 行里(与复制键争宽)→ word-break 逐字换行。 改为独立整行 .addr 块(全宽自然换行),复制键下移全宽。 - 风格:改用官网 light 暖色 token(sand/clay,主色 #B96A3D、sage 绿 #5B8C5A、JetBrains Mono),内联对齐 design/prototype/tokens.css。 - 页脚补一句「测什么」:收款订单闭环 POST /order + GET /order/{id} 轮询到 paid。 Co-Authored-By: Claude Opus 4.8 --- pay/internal/httpapi/testpage.go | 133 +++++++++++++++++++------------ 1 file changed, 82 insertions(+), 51 deletions(-) diff --git a/pay/internal/httpapi/testpage.go b/pay/internal/httpapi/testpage.go index 562cb54..ebf4dbc 100644 --- a/pay/internal/httpapi/testpage.go +++ b/pay/internal/httpapi/testpage.go @@ -8,6 +8,11 @@ import "net/http" // money-critical Phase E loop (create order → pay exact amount → watch paid), // NOT the production checkout (that lives on the storefront). It only creates // orders and polls status — no secrets, no keys. +// +// Styling mirrors the marketing site's warm sand/clay palette (design tokens in +// design/prototype/tokens.css, light theme default, brand = clay-500 #B96A3D). +// Values are inlined here because pangolin-pay is a separate origin and cannot +// @import the site's stylesheet; keep them in sync if the brand palette changes. func (h *Handler) testPage(w http.ResponseWriter, _ *http.Request) { w.Header().Set("Content-Type", "text/html; charset=utf-8") w.Header().Set("Cache-Control", "no-store") @@ -20,55 +25,78 @@ const testPageHTML = ` + pangolin-pay · 收款测试
-

pangolin-pay · 收款测试

+

pangolin-pay · 收款测试

USDT-TRC20 · 单地址 + 唯一金额 · 手动测试页(非生产收银台)

@@ -91,19 +119,20 @@ const testPageHTML = ` 状态
-
-
请支付精确金额(多付少付都不匹配)
+ +
+
请支付精确金额(多付少付都不匹配)
-
-
- 收款地址 - - - - + + +
+
收款地址
+
-
+ + +
TxID
@@ -111,18 +140,20 @@ const testPageHTML = ` 过期倒计时
+
发往此地址、且金额正好等于上面数字的 USDT-TRC20 转账,会在 watcher 下一轮轮询后自动标记 paid。金额不符 → 进 orphan 需人工对账。
- ⚠️ 需 TRONGRID_API_KEY 已配置,否则 watcher 被限流可能侦测很慢。 + ⚠️ 需 TRONGRID_API_KEY 已配置,否则 watcher 被限流、侦测很慢。

- 地址模型:所有订单收到同一地址,靠唯一金额(基准价 + 微尾数 ≤0.01U)区分。 - 本页仅调 POST /orderGET /order/{id},无私钥、无密钥。 + 测什么:收款订单闭环 —— POST /order 建单拿地址+唯一金额、GET /order/{id} + 轮询到 paid。地址模型:所有订单收到同一地址,靠唯一金额(基准价 + 微尾数 + ≤0.01U)区分。本页无私钥、无密钥。