Fix refund pending finalization gaps

This commit is contained in:
wucm667
2026-06-30 10:19:50 +08:00
parent 7316d83027
commit 93a3bf3077
17 changed files with 591 additions and 39 deletions
+14 -1
View File
@@ -49,6 +49,14 @@ export interface UpdatePaymentConfigRequest {
help_text?: string
}
export interface RefundResult {
success: boolean
warning?: string
require_force?: boolean
balance_deducted?: number
subscription_days_deducted?: number
}
export const adminPaymentAPI = {
// ==================== Config ====================
@@ -105,7 +113,12 @@ export const adminPaymentAPI = {
/** Process a refund */
refundOrder(id: number, data: { amount: number; reason: string; deduct_balance?: boolean; force?: boolean }) {
return apiClient.post(`/admin/payment/orders/${id}/refund`, data)
return apiClient.post<RefundResult>(`/admin/payment/orders/${id}/refund`, data)
},
/** Query and finalize a pending refund */
queryRefund(id: number) {
return apiClient.post<RefundResult>(`/admin/payment/orders/${id}/refund/query`)
},
// ==================== Channels ====================