Commit 162f7736 by xuzhenzhao

feat(custom): replace topay api

-
parent d08b360d
...@@ -3,8 +3,17 @@ const BASE_URL_JAVA = process.env.NODE_ENV === 'production' ? 'https://api.ydl.c ...@@ -3,8 +3,17 @@ const BASE_URL_JAVA = process.env.NODE_ENV === 'production' ? 'https://api.ydl.c
const BASE_GATEWAY = process.env.NODE_ENV === 'production' ? 'https://app2.yidianling.com' : 'https://testapp2.yidianling.com' const BASE_GATEWAY = process.env.NODE_ENV === 'production' ? 'https://app2.yidianling.com' : 'https://testapp2.yidianling.com'
/**
* doc: http://47.96.181.183:8806/api/swagger-ui.html#!/finance45v45245controller/doUnityPayUsingPOST
*/
export const DO_UNIFIED_ORDER = `${BASE_URL_JAVA}/api/auth/cashierV2/doUnifiedOrder` export const DO_UNIFIED_ORDER = `${BASE_URL_JAVA}/api/auth/cashierV2/doUnifiedOrder`
/**
* 新版支付,api同doUnifiedOrder
* doc: http://47.96.181.183:8806/api/swagger-ui.html#!/finance45v45245controller/unityPayUsingPOST
*/
export const UNIT_PAY = `${BASE_URL_JAVA}/api/auth/cashierV2/unityPay`
export const COMMIT_ORDER = `${BASE_URL_JAVA}/api/consult/consult/commit-order` export const COMMIT_ORDER = `${BASE_URL_JAVA}/api/consult/consult/commit-order`
export const IS_PAY = `${BASE_URL_JAVA}/api/auth/Order/isPay` export const IS_PAY = `${BASE_URL_JAVA}/api/auth/Order/isPay`
......
import {DO_UNIFIED_ORDER, IS_PAY, MY_BALANCE} from "./API"; import {UNIT_PAY, IS_PAY, MY_BALANCE} from "./API";
import md5 from 'blueimp-md5' import md5 from 'blueimp-md5'
import qs from 'qs' import qs from 'qs'
import {Utils} from "@/Utils/Utils"; import {Utils} from "@/Utils/Utils";
...@@ -224,7 +224,7 @@ export class Payment { ...@@ -224,7 +224,7 @@ export class Payment {
if (payChannel !== null) { if (payChannel !== null) {
doUnifiedParams.payChannel = payChannel doUnifiedParams.payChannel = payChannel
} }
const res = await requestForJava.post<DoUnifiedParams, DefaultResponse>(DO_UNIFIED_ORDER, doUnifiedParams) const res = await requestForJava.post<DoUnifiedParams, DefaultResponse>(UNIT_PAY, doUnifiedParams)
if (res.code !== '200') return {errorMessage: res.msg as any, success: false, errorType: PayError.BACKEND} if (res.code !== '200') return {errorMessage: res.msg as any, success: false, errorType: PayError.BACKEND}
if (params.payType === PayType.BALANCE && res.data.balancePayResult) { if (params.payType === PayType.BALANCE && res.data.balancePayResult) {
return {success: res.data.balancePayResult === 'true', errorType: PayError.BALANCE} return {success: res.data.balancePayResult === 'true', errorType: PayError.BALANCE}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment