优化支付退款钱包链路

This commit is contained in:
yml
2026-06-03 21:47:04 +08:00
parent 04193ae687
commit c80d3f960e
26 changed files with 1342 additions and 504 deletions
+34
View File
@@ -174,6 +174,40 @@ export async function adminMarkOrderAbnormal(id: number, reason: string) {
return data.data
}
export interface RefundStatus {
order_id: number
order_no: string
refund_status: string
refund_amount_cent: number
refunded_at?: string
total_amount: number
}
export async function adminRefundOrder(id: number) {
const { data } = await apiClient.post<ApiResponse<RefundStatus>>(`/admin/orders/${id}/refund`)
return data.data
}
export async function adminRefundStatus(id: number) {
const { data } = await apiClient.get<ApiResponse<RefundStatus>>(`/admin/orders/${id}/refund-status`)
return data.data
}
export interface StartOrderPaymentRequest {
pay_way?: string
jspay_flag?: string
}
export async function startOrderPayment(orderId: number, req?: StartOrderPaymentRequest) {
const { data } = await apiClient.post<ApiResponse<PaymentOrder>>(`/orders/${orderId}/start-payment`, req || {})
return data.data
}
export async function queryOrderPayment(orderId: number) {
const { data } = await apiClient.get<ApiResponse<PaymentOrder>>(`/orders/${orderId}/query-payment`)
return data.data
}
export async function confirmReceive(id: number) {
const { data } = await apiClient.post<ApiResponse<{ received: boolean }>>(`/orders/${id}/confirm-receive`)
return data.data