feat(admin): add create-and-redeem endpoint for payment integrations#685
Open
touwaeriol wants to merge 4 commits intoWei-Shaw:mainfrom
Open
feat(admin): add create-and-redeem endpoint for payment integrations#685touwaeriol wants to merge 4 commits intoWei-Shaw:mainfrom
touwaeriol wants to merge 4 commits intoWei-Shaw:mainfrom
Conversation
…try to recharge/subscription
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.
背景 / Background
为 sub2api 集成外部支付系统补齐服务端充值接口与前端参数透传能力,并提供可交付的中英双语单文件 API 文档。
This PR completes backend recharge integration APIs and frontend parameter passthrough for external payment systems, with a deliverable single-file bilingual API documentation.
改动目的 / Purpose
变更内容 / What Changed
A. 核心功能(原范围) / Core Features (original scope)
中文
POST /api/v1/admin/redeem-codes/create-and-redeemexecuteAdminIdempotentJSON中,要求Idempotency-Keycode+ 同用户 =>200code+ 不同用户 =>409RedeemService支持外部传入确定性code,用于支付订单映射user_idtokenthemeui_mode=embeddedEnglish
POST /api/v1/admin/redeem-codes/create-and-redeemexecuteAdminIdempotentJSON, requiringIdempotency-Keycode+ same user =>200code+ different user =>409RedeemServiceto support caller-provided deterministiccodeuser_idtokenthemeui_mode=embeddedB. 本次补充优化 / Additional improvements
中文
ADMIN_PAYMENT_INTEGRATION_API.md升级为中英双语单文件购买订阅->充值/订阅购买订阅页面->充值/订阅页面/purchase图标优化为“充值语义(卡片 + 加号)”Icon.vue中rechargeSubscription),不再在侧边栏局部写 SVG 路径English
ADMIN_PAYMENT_INTEGRATION_API.mdto a single-file bilingual documentPurchase Subscription->Recharge / SubscriptionPurchase Subscription Page->Recharge / Subscription Page/purchaseicon to a recharge-oriented icon (card + plus)rechargeSubscriptioninIcon.vue) instead of local SVG path in sidebar文档 / Docs
验证 / Validation
go test ./internal/handler/admin -run TestRedeemHandlerEndpoints -count=1go test ./internal/server/routes -count=1go test ./internal/service -run TestRedeem -count=1pnpm --dir frontend run typecheck