面向开发/维护人员的系统级说明,覆盖:分层、关键模型与状态、主链路、边界与异常、回调与定时、遗留链路与迁移建议。
/api/user/pay/*/api/product_licenses/*, /api/work_tasks/*, /api/orders/*/api/user/wallets*, /api/user/wallet_withdraws*/api/internal/pending_payout/*ProductPaymentServiceWorkTaskPaymentServiceWalletDeductionServiceProductLicenseService, ProductLicenseFileServiceWorkTaskCompletionServiceCompletionSettlementService(CNY 与非 CNY 分支)Wallet* 系列服务(提现、转账、交易记录)ExpirePaymentSessions 过期会话清理busable_type, busable_id, amount, currency_id, status, out_trade_no, amount_calc_processpending / paying / paid / cancelledbusable_type 依赖 morphMap(product_license, work_task)user_id, artist_id, product_id, product_option_id, price, currency_id, statuspending / paying / paid / cancelled / refundedwait_pay, working, finished, user_canceled 等is_paid + work_status(pending, working, finished)pending, wait_pay, paid, rejected, canceleddeposit(收款/提现), credit(用户抵扣), plat_fee(平台费抵扣)alipay, stripe_payout, stripe_deductionpending, wallet_deposited, refunded入口:/api/user/pay/product/* + /api/product_licenses/*
关键规则:
入口:/api/user/pay/work_task/*
关键规则:
price_change 与 stage_pay/full_pay 互斥OrderWalletDeductionRecord 在结算时更新状态/api/internal/pending_payout/*checkout.session.completed → OrderService::processPaymentcheckout.session.expired → 取消订单AlipayWebhookService::processCompletedExpirePaymentSessions → 清理过期会话| 领域 | 方法 | 路径 | 说明 |
|---|---|---|---|
| WorkTask 支付 | POST | /api/user/pay/work_task/pre_calc | 预计算金额 |
| WorkTask 支付 | POST | /api/user/pay/work_task/create_checkout_session | 创建支付会话 |
| WorkTask 支付 | POST | /api/user/pay/work_task/confirm_zero | 零元确认 |
| Product 支付 | POST | /api/user/pay/product/pre_calc | 预计算金额 |
| Product 支付 | POST | /api/user/pay/product/create_checkout_session | 创建支付会话 |
| Product 支付 | POST | /api/user/pay/product/confirm_zero | 零元确认 |
| Product License | POST | /api/product_licenses/list | 列表 |
| Product License | POST | /api/product_licenses/info | 详情 |
| Product License | POST | /api/product_licenses/continue_payment | 继续支付 |
| Product License | POST | /api/product_licenses/cancel | 取消 |
| License Files | POST | /api/product_licenses/files/list | 文件列表 |
| License Files | POST | /api/product_licenses/files/histories | 版本历史 |
| License Files | POST | /api/product_licenses/files/download | 下载 |
| WorkTask 业务 | POST | /api/work_tasks/confrim_stage_work_status | 确认阶段完成 |
| Order | POST | /api/orders/cancel | 取消订单 |
| Order | POST | /api/orders/continue | 继续支付 |
| Alipay 回调 | GET/POST | /api/user/alipay/return /api/user/alipay/notify | 支付回调 |
| 内部统计 | POST | /api/internal/pending_payout/summary | 待支付汇总 |
| 内部统计 | POST | /api/internal/pending_payout/details | 待支付明细 |
confirm_zeroProductPurchaseService 仍存在但未在新支付链路中使用ProductOrder + StripeController::createProductCheckoutSession 为旧模式OrderService 的统一处理ProductPaymentService + ProductLicenseProductPurchase/ProductOrder 映射为 ProductLicense + OrderOrderService 处理可继续输出的扩展图:
如需我继续补充上述扩展图或测试建议,请告知。