新增撞车订单人工退款
This commit is contained in:
@@ -84,6 +84,20 @@ export interface MohongConfig {
|
||||
order_copy_template: string
|
||||
}
|
||||
|
||||
export interface MohongRefundResult {
|
||||
id: number
|
||||
payment_no: string
|
||||
order_id: number
|
||||
order_no: string
|
||||
biz_type: string
|
||||
amount_cent: number
|
||||
status: string
|
||||
provider_order_id?: string
|
||||
paid_at?: string | null
|
||||
created_at: string
|
||||
updated_at: string
|
||||
}
|
||||
|
||||
export interface Paginated<T> {
|
||||
items: T[]
|
||||
total: number
|
||||
@@ -287,6 +301,17 @@ export async function cancelAdminMohongOrder(id: number, reason?: string) {
|
||||
return data.data
|
||||
}
|
||||
|
||||
export async function refundAdminMohongOrder(id: number, amountCent?: number, remark?: string) {
|
||||
const { data } = await apiClient.post<ApiResponse<MohongRefundResult>>(
|
||||
`/admin/crash/orders/${id}/refund`,
|
||||
{
|
||||
amount_cent: Number(amountCent || 0),
|
||||
remark: remark || '',
|
||||
}
|
||||
)
|
||||
return data.data
|
||||
}
|
||||
|
||||
export async function fetchAdminMohongConfig() {
|
||||
const { data } = await apiClient.get<ApiResponse<MohongConfig>>('/admin/crash/config')
|
||||
return data.data
|
||||
|
||||
Reference in New Issue
Block a user