Commit c0907acc by zhengxiao

feat: 新增兼容paypal支付方式

parent dc05037d
...@@ -54,8 +54,11 @@ export enum PayType { ...@@ -54,8 +54,11 @@ export enum PayType {
/** /**
* 花呗分期 + 余额支付 * 花呗分期 + 余额支付
*/ */
HUABEI_STAGE_BALANCE = 13 HUABEI_STAGE_BALANCE = 13,
/**
* 贝宝支付
*/
PAYPAY = 26
} }
/** /**
...@@ -70,7 +73,8 @@ export enum PayChannel { ...@@ -70,7 +73,8 @@ export enum PayChannel {
ALI_APP = 'ALI_APP', ALI_APP = 'ALI_APP',
ALI_PC = 'ALI_PC', ALI_PC = 'ALI_PC',
ALI_QR = 'ALI_QR', ALI_QR = 'ALI_QR',
ALI_PCREDIT = 'ALI_PCREDIT' ALI_PCREDIT = 'ALI_PCREDIT',
PAYPAY = 'PAYPAY'
} }
export type ToPayParams = { export type ToPayParams = {
...@@ -126,9 +130,10 @@ export enum PayErrorMessage { ...@@ -126,9 +130,10 @@ export enum PayErrorMessage {
export type ToPayReturns = { export type ToPayReturns = {
errorMessage?: PayErrorMessage errorMessage?: PayErrorMessage
errorType: PayError errorType?: PayError
success: boolean success?: boolean
payUrl?: string payUrl?: string
payPalOrderId?: string
} }
......
...@@ -307,12 +307,20 @@ export class Payment { ...@@ -307,12 +307,20 @@ export class Payment {
errorType: PayError.ALIPAY_H5_BREAK, errorType: PayError.ALIPAY_H5_BREAK,
errorMessage: PayErrorMessage.ALIPAY_H5_PAY_BREAK errorMessage: PayErrorMessage.ALIPAY_H5_PAY_BREAK
} }
} else if (payChannel === PayChannel.PAYPAY) {
return {
payPalOrderId: res.data.content.payPalOrderId,
errorMessage: res.msg as any
}
} }
return {success: false, errorType: PayError.UNKNOWN} return {success: false, errorType: PayError.UNKNOWN}
} }
private getPayChannel(payType: PayType): PayChannel | null { private getPayChannel(payType: PayType): PayChannel | null {
switch (payType) { switch (payType) {
case PayType.PAYPAY:
return PayChannel.PAYPAY
case PayType.WECHAT_BALANCE: case PayType.WECHAT_BALANCE:
case PayType.WECHAT: case PayType.WECHAT:
return Utils.isWechat() ? PayChannel.WX_JSAPI : PayChannel.WX_MWEB return Utils.isWechat() ? PayChannel.WX_JSAPI : PayChannel.WX_MWEB
......
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