fix(payment): integrate recharge fee rate in order flow and fix UI display

Backend:
- Use cfg.RechargeFeeRate in order creation instead of hardcoded 0
- Remove dead getFeeRate stub method
- All amounts computed server-side: order_amount, pay_amount, fee_rate

Frontend - PaymentView:
- Read recharge_fee_rate from checkout-info API (not per-method)
- Show fee breakdown only when fee_rate > 0
- Show credited amount only when multiplier ≠ 1

Frontend - Order display (user + admin):
- Fix fee_rate * 100 bug (fee_rate is already a percentage)
- OrderTable: show pay_amount as primary, fee/credited as sub-lines
- AdminOrderDetail: full breakdown (base/fee/paid/credited)
- AdminRefundDialog: label "到账金额" for clarity
- PaymentResultView: show pay_amount with fee info

Types + i18n:
- Add recharge_fee_rate to CheckoutInfoResponse
- Add fee_rate to CreateOrderResult
- Add translations: creditedAmount, fee, baseAmount, includedInPayAmount
This commit is contained in:
erio
2026-04-15 01:04:01 +08:00
parent 98140f6cac
commit e761d38fd1
12 changed files with 71 additions and 32 deletions

View File

@@ -64,6 +64,7 @@ export interface CheckoutInfoResponse {
plans: SubscriptionPlan[]
balance_disabled: boolean
balance_recharge_multiplier: number
recharge_fee_rate: number
help_text: string
help_image_url: string
stripe_publishable_key: string
@@ -162,6 +163,7 @@ export interface CreateOrderResult {
qr_code?: string
client_secret?: string
pay_amount: number
fee_rate: number
expires_at: string
payment_mode?: string
}