You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import request from '@/utils/request'
|
|
|
|
|
|
|
|
// api地址
|
|
|
|
const api = {
|
|
|
|
orderInfo: 'cashier/orderInfo',
|
|
|
|
orderPay: 'cashier/orderPay',
|
|
|
|
tradeQuery: 'cashier/tradeQuery',
|
|
|
|
unify: 'goods/unify',
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 获取支付订单的信息
|
|
|
|
* @param {Number} orderId
|
|
|
|
* @param {Object} param
|
|
|
|
*/
|
|
|
|
export function orderInfo(orderId, param) {
|
|
|
|
return request.get(api.orderInfo, { orderId, ...param })
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 确认支付
|
|
|
|
* @param {Number} orderId
|
|
|
|
* @param {Object} data
|
|
|
|
*/
|
|
|
|
export function orderPay(orderId, data) {
|
|
|
|
return request.post(api.orderPay, { orderId, ...data })
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 交易查询
|
|
|
|
* 查询第三方支付订单是否付款成功
|
|
|
|
* @param {Object} param
|
|
|
|
*/
|
|
|
|
export function tradeQuery(param) {
|
|
|
|
return request.get(api.tradeQuery, param)
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 查询第三方支付信息
|
|
|
|
* @param {Object} param
|
|
|
|
*/
|
|
|
|
export function unify(param) {
|
|
|
|
return request.get(api.unify, param)
|
|
|
|
}
|