41 lines
1.5 KiB
JavaScript
41 lines
1.5 KiB
JavaScript
import {
|
|
request
|
|
} from './http.js'
|
|
// 公共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
|
|
bdPayParams:'/api/accountrecharge/save-bd-pay-order-info'
|
|
}
|
|
class PayApi {
|
|
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, null, "operator")
|
|
}
|
|
//获取百度支付参数
|
|
static doGetBdPayParams(data){
|
|
return request(apiPath.bdPayParams,"POST",data,null,"operator")
|
|
}
|
|
}
|
|
|
|
export default PayApi; |