Commit 214f7101 by 郑炬波

feat: 组合支付

parent 8883e158
{ {
"name": "@ydl-packages/toolkit", "name": "@ydl-packages/toolkit",
"version": "1.0.4-next.1", "version": "1.0.4-next.3",
"description": "", "description": "",
"main": "./dist/index.umd.js", "main": "./dist/index.umd.js",
"scripts": { "scripts": {
......
let BASE_URL_JAVA = ""; let BASE_URL_JAVA = "";
let BASE_GATEWAY = ""; let BASE_GATEWAY = "";
const isTest = typeof window !== 'undefined' ? window.location.hostname.indexOf("-test") > -1 : false; const isTest = typeof window !== 'undefined' ? window.location.hostname.indexOf("-test") > -1 : false;
const isProd = typeof window !== 'undefined' ? (window.location.hostname.indexOf("dev") == -1 && window.location.hostname.indexOf("test") == -1) : false; const isProd = typeof window !== 'undefined' ? (window.location.hostname.indexOf("dev") == -1 && window.location.hostname.indexOf("test") == -1 && window.location.hostname.indexOf("localhost") == -1 && window.location.hostname.indexOf("127.0.0.1") == -1) : false;
if(isProd){ if(isProd){
BASE_URL_JAVA = 'https://api.ydl.com'; BASE_URL_JAVA = 'https://api.ydl.com';
BASE_GATEWAY = 'https://app2.yidianling.com' BASE_GATEWAY = 'https://app2.yidianling.com'
......
...@@ -74,7 +74,8 @@ export enum PayChannel { ...@@ -74,7 +74,8 @@ export enum PayChannel {
export type ToPayParams = { export type ToPayParams = {
orderId: number; orderId: number;
totalAmount: number subOrderIds?: string;
totalAmount: number;
payType: PayType; payType: PayType;
/** /**
* 支付宝h5支付失败回调地址 * 支付宝h5支付失败回调地址
......
...@@ -189,7 +189,7 @@ export class Payment { ...@@ -189,7 +189,7 @@ export class Payment {
} }
async toPay(params: ToPayParams): Promise<ToPayReturns> { async toPay(params: ToPayParams): Promise<ToPayReturns> {
const {totalAmount, payType, returnUrl, orderId, redirectUrl} = params const {totalAmount, payType, returnUrl, orderId, subOrderIds, redirectUrl} = params
let quitUrl = params.quitUrl let quitUrl = params.quitUrl
// validate start >>> // validate start >>>
switch (payType) { switch (payType) {
...@@ -258,7 +258,8 @@ export class Payment { ...@@ -258,7 +258,8 @@ export class Payment {
orderId, orderId,
payType, payType,
payAmount, payAmount,
payBalance payBalance,
subOrderIds
} }
if (payChannel !== null) { if (payChannel !== null) {
doUnifiedParams.payChannel = payChannel doUnifiedParams.payChannel = payChannel
......
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