36 lines
1.4 KiB
JavaScript
36 lines
1.4 KiB
JavaScript
import {
|
|
request
|
|
} from "../http";
|
|
// 公共API
|
|
const apiPath = {
|
|
getBuyPackageList: '/api/proj/servicepkg/packageinfo/listpage/${type}/self', //获取可以购买的套餐包列表
|
|
getPayOrder: '/api/pay/get-pay', //获取支付订单
|
|
enterprisePay: '/api/pay/pay-account-recharge/${accountRechargeId}', //企业付款完成支付
|
|
enterpriseAccountInfo: '/api/pay/get-pay-system-bank', //获取公司账户信息
|
|
wxPayParams: '/api/accountrecharge/save-wx-pay-prepay-id', //获取微信支付所需参数 rechargeMoney金额 packageInfoId套餐包ID
|
|
}
|
|
class PayService {
|
|
static doGetBuyPackageList(type, data) {
|
|
const path = apiPath.getBuyPackageList.replace('${type}', type);
|
|
return request(path, "GET", data);
|
|
}
|
|
//对公转账完成
|
|
static doCompleteEnterprisePay(url, data) {
|
|
const path = apiPath.enterprisePay.replace('${accountRechargeId}', url)
|
|
return request(path, "POST", data)
|
|
}
|
|
//获取账户信息
|
|
static doGetEnterpriseAccountInfo() {
|
|
return request(apiPath.enterpriseAccountInfo, "GET")
|
|
}
|
|
//获取订单
|
|
static doGetOrder(data) {
|
|
return request(apiPath.getPayOrder, "POST", data)
|
|
}
|
|
//获取微信支付参数
|
|
static doGetWxPayParams(data) {
|
|
return request(apiPath.wxPayParams, "POST", data, "operator")
|
|
}
|
|
}
|
|
|
|
export default PayService; |