Commit c0907acc by zhengxiao

feat: 新增兼容paypal支付方式

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