Simplify account payment flow and harden direct transfers

This commit is contained in:
2569718930@qq.com
2026-06-14 06:58:45 +08:00
parent 715d79c9b5
commit 0f497ab822
15 changed files with 310 additions and 167 deletions
@@ -80,10 +80,14 @@ export function runTests() {
"AccountCenter must validate backend-returned manual payment receiver before displaying it",
);
assert(
/!\(\s*txValidation\.checked\s*&&\s*txValidation\.valid === true\s*\)/.test(
accountCenterSource,
),
"manual payment submit button must require checked && valid === true",
accountCenterSource.includes("manualTxHashReady") &&
accountCenterSource.includes("/^0x[a-fA-F0-9]{64}$/") &&
!/!\(\s*txValidation\.checked\s*&&\s*txValidation\.valid === true\s*\)/.test(
accountCenterSource,
) &&
paymentFlowSource.includes("const submitRes = await fetch(`/api/payments/intents/${intentIdVal}/submit`") &&
paymentFlowSource.includes("const confirmRes = await fetch(`/api/payments/intents/${intentIdVal}/confirm`"),
"manual payment submit button may proceed with a well-formed tx hash, but backend submit/confirm must remain the authority",
);
assert(
paymentFlowSource.includes("validateTxHash") &&