upload project source code
This commit is contained in:
25
前端源码/uni-app/api/payment.ts
Normal file
25
前端源码/uni-app/api/payment.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* 支付相关接口
|
||||
*/
|
||||
import http from '@/utils/request';
|
||||
import type { CreateOrderParams, CreateOrderResponse, QueryOrderResponse, CloseOrderResponse, ListPayOrdersParams, ListPayOrdersResponse } from './types';
|
||||
|
||||
export const paymentApi = {
|
||||
// 创建支付订单
|
||||
createOrder: (params: CreateOrderParams) =>
|
||||
http.post<CreateOrderResponse>('/yifan_wx_pay/create-order', params, { showLoading: true }),
|
||||
|
||||
// 查询订单状态(使用路径参数)
|
||||
queryOrder: (out_trade_no: string) =>
|
||||
http.get<QueryOrderResponse>(`/yifan_wx_pay/query-order/${out_trade_no}`),
|
||||
|
||||
// 关闭订单(使用路径参数)
|
||||
closeOrder: (out_trade_no: string) =>
|
||||
http.post<CloseOrderResponse>(`/yifan_wx_pay/close-order/${out_trade_no}`, {}, { showLoading: true }),
|
||||
|
||||
// 获取支付订单列表
|
||||
listOrders: (params?: ListPayOrdersParams) =>
|
||||
http.get<ListPayOrdersResponse>('/yifan_wx_pay/list', params),
|
||||
};
|
||||
|
||||
export default paymentApi;
|
||||
Reference in New Issue
Block a user