44 lines
1.6 KiB
TypeScript
44 lines
1.6 KiB
TypeScript
export type WechatPayChannel = 'WECHAT_JS' | 'WECHAT_MP' | 'WECHAT_NATIVE' | 'WECHAT_H5' | 'WECHAT_APP';
|
|
export interface ConfigBase {
|
|
channel: string;
|
|
}
|
|
export interface ThirdPartyConfig extends ConfigBase {
|
|
payNotifyUrl: string;
|
|
refundNotifyUrl: string;
|
|
lossRatio: number;
|
|
refundGapDays?: number;
|
|
refundLossRatio?: number;
|
|
refundLossFloor?: 1 | 2 | 3;
|
|
}
|
|
export interface WechatPayConfig extends ThirdPartyConfig {
|
|
channel: WechatPayChannel;
|
|
mchId: string;
|
|
publicKeyFilePath: string;
|
|
privateKeyFilePath: string;
|
|
apiV3Key: string;
|
|
}
|
|
export type AccountPayChannel = 'ACCOUNT';
|
|
export interface AccountPayConfig extends ConfigBase {
|
|
channel: AccountPayChannel;
|
|
depositLoss: boolean;
|
|
depositLossRatio?: number;
|
|
}
|
|
export type OfflinePayChannel = 'OFFLINE';
|
|
export interface OfflinePayConfig extends ConfigBase {
|
|
tips: string;
|
|
channel: OfflinePayChannel;
|
|
options?: string[];
|
|
allowUser?: boolean;
|
|
}
|
|
export type Channel = WechatPayChannel | AccountPayChannel | OfflinePayChannel;
|
|
export type PayConfig = Array<WechatPayConfig | AccountPayConfig | OfflinePayConfig>;
|
|
export declare const PAY_CHANNEL_ACCOUNT_NAME = "ACCOUNT";
|
|
export declare const PAY_CHANNEL_OFFLINE_NAME = "OFFLINE";
|
|
export declare const PAY_CHANNEL_WECHAT_JS_NAME = "WECHAT_JS";
|
|
export declare const PAY_CHANNEL_WECHAT_MP_NAME = "WECHAT_MP";
|
|
export declare const PAY_CHANNEL_WECHAT_H5_NAME = "WECHAT_H5";
|
|
export declare const PAY_CHANNEL_WECHAT_APP_NAME = "WECHAT_APP";
|
|
export declare const PAY_CHANNEL_WECHAT_NATIVE_NAME = "WECHAT_NATIVE";
|
|
export declare const PAY_WECHAT_CHANNELS: string[];
|
|
export declare const PAY_ORG_CHANNELS: string[];
|