Repository navigation
feat(billing): connect subscription checkout to payment APIs - #956
Merged
xiaocheny214 merged 9 commits intoOct 15, 2026
Merged
Conversation
The checkout needs the existing backend billing contract. Map products, subscriptions and orders through the shared API client. Keep money in integer fen and disable automatic mutation replay.
Payment state must follow the backend order lifecycle. Add billing resources with stale-response guards and sequential polling. Prevent duplicate submissions and re-read orders after close attempts.
Checkout needs recognizable Alipay and WeChat Pay choices. Bundle the official source artwork with its provenance and license notice. Render payment branding locally without an external image request.
Purchases need channel selection and a resumable order view. Add checkout and history components using the existing dialog styling. Require server-confirmed status before presenting a completed payment.
The purchase controls currently stop at a placeholder dialog. Bind the original page to products, checkout, subscription balances and order history. Preserve the stylesheet and recover orders from return parameters.
The account menu always labels the subscription as Free. Read the subscription when the authenticated account menu opens. Display the actual tier and link existing members to subscription management.
The frontend adapter must match the existing billing responses. Exercise request payloads and response mapping through an isolated HTTP fixture. Cover authenticated creation, server prices, pagination and close requests.
Payment returns and delayed requests must not create false success. Exercise polling, stale responses, duplicate clicks, price changes and close compensation. Verify the page follows server state across checkout failures and returns.
The account menu must reflect existing paid membership. Inject the billing HTTP fixture and assert the Pro management link. Keep unrelated account tests isolated from live billing requests.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #956 +/- ##
=======================================
Coverage 91.01% 91.01%
=======================================
Files 205 205
Lines 14231 14231
=======================================
Hits 12953 12953
Misses 1278 1278
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
One reportable checkout state defect was found in the fixed pull request. Focused tests could not be executed because frontend dependencies are not installed (vitest: not found); no unrelated issues were identified.
Reviewed head commit: 84f8642af38dff3058f64814d40ded5351159bcf
- [P1] Switch to the created order after checkout (
frontend/src/pages/subscription/checkout-dialog.tsx:75-80) — see inline comment
xiaocheny214
self-requested a review
October 15, 2026 13:30
xiaocheny214
approved these changes
Oct 15, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
在原订阅与充值页面接入现有账单接口,支持套餐购买、积分充值、收银台跳转和支付结果查询,保留原页面布局与样式。
Why
原购买按钮只打开“支付还没有接入”的提示,套餐和会员档位也是固定值。后端 #954 已提供商品、订单及订阅接口,需要补齐前端调用与订单状态处理。
Changes
Implementation
entities/bill负责账单契约与传输映射,复用共享认证和 API 客户端。features/billing负责资源加载、订单轮询与提交状态;写请求关闭认证后的自动重放,避免重复下单。subscription.css,该样式文件无改动;新增控件使用 Tailwind 与现有 token。Verification
npm test -- src/entities/bill/api.test.ts src/features/billing/index.test.ts src/pages/subscription/index.test.tsx src/app/layout/app-header.test.tsx:4 个文件、57 项测试通过。./node_modules/.bin/oxlint src/entities/bill src/entities/index.ts src/features/billing src/pages/subscription src/test/bill-backend.ts src/app/layout/app-header.tsx src/app/layout/app-header.test.tsx:通过;本次变更文件的oxfmt --check通过。VITE_API_BASE_URL=/api npm run build:类型检查与生产构建通过;仅有既有大包体积提示。Scope
本 PR 仅交付前端接入,不包含后端部署或商户配置。当前环境尚未部署 #954 的支付接口;真实网关下单、付款和异步回调尚未验证,后续由队友部署后联调验收。
Related Issues
Closes #955
Refs #947
Refs #954