feat(payment): 新增支付订单创建和状态查询功能
- 添加创建支付订单接口 - 添加查询订单状态接口 - 添加获取收银台页面URL方法 - 创建支付结果展示页面 PaymentResult.vue - 实现订单信息展示和状态判断逻辑 - 添加支付成功、失败、审核中等状态显示 - 集成 Element Plus 的结果页组件和描述列表 - 实现继续支付和查询订单操作按钮
This commit is contained in:
30
src/api/payment.js
Normal file
30
src/api/payment.js
Normal file
@@ -0,0 +1,30 @@
|
||||
import request from './request'
|
||||
|
||||
/**
|
||||
* 创建支付订单
|
||||
*/
|
||||
export function createPaymentOrder(data) {
|
||||
return request({
|
||||
url: '/payment/checkout',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单状态
|
||||
*/
|
||||
export function getOrderStatus(merchantTransactionId) {
|
||||
return request({
|
||||
url: `/payment/order/${merchantTransactionId}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取收银台页面URL
|
||||
*/
|
||||
export function getCheckoutPageUrl(token) {
|
||||
return `/api/payment/checkout/page?token=${token}`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user