完善支付功能,添加支付宝的准备与创建逻辑
This commit is contained in:
@@ -21,28 +21,47 @@ async function allResource(){
|
||||
return callByUser<Resource[]>('/api/resource/all')
|
||||
}
|
||||
|
||||
async function createResourceByBalance(props: {
|
||||
type CreateResourceReq = {
|
||||
type: number
|
||||
live: number
|
||||
quota: number
|
||||
expire: number
|
||||
daily_limit: number
|
||||
}) {
|
||||
}
|
||||
|
||||
type CreateResourceResp = {
|
||||
trade_no: string
|
||||
pay_url: string
|
||||
}
|
||||
|
||||
async function createResourceByBalance(props: CreateResourceReq) {
|
||||
return await callByUser('/api/resource/create/balance', props)
|
||||
}
|
||||
|
||||
async function createResourceByAlipay() {
|
||||
throw new Error('Not implemented')
|
||||
async function prepareResourceByAlipay(props: CreateResourceReq) {
|
||||
return await callByUser<CreateResourceResp>('/api/resource/prepare/alipay', props)
|
||||
}
|
||||
|
||||
async function createResourceByWechat() {
|
||||
throw new Error('Not implemented')
|
||||
async function prepareResourceByWechat(props: CreateResourceReq) {
|
||||
return await callByUser<CreateResourceResp>('/api/resource/prepare/wechat', props)
|
||||
}
|
||||
|
||||
async function createResourceByAlipay(props: CreateResourceReq) {
|
||||
return await callByUser('/api/resource/create/alipay', props)
|
||||
}
|
||||
|
||||
async function createResourceByWechat(props: CreateResourceReq) {
|
||||
return await callByUser('/api/resource/create/wechat', props)
|
||||
}
|
||||
|
||||
export {
|
||||
listResourcePss,
|
||||
allResource,
|
||||
prepareResourceByAlipay,
|
||||
prepareResourceByWechat,
|
||||
createResourceByBalance,
|
||||
createResourceByAlipay,
|
||||
createResourceByWechat,
|
||||
type CreateResourceReq,
|
||||
type CreateResourceResp,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user