Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
type TStatus = '9000' | '8000' | '4000' | '5000' | '6001' | '6002';
export type AlipayResultCode = '9000' | '8000' | '4000' | '5000' | '6001' | '6002';

interface IResult {
resultStatus: TStatus;
export interface AlipayResult {
resultStatus: AlipayResultCode;
result: string;
memo: string;
}

declare namespace Alipay {

function authWithInfo(infoStr: string): IResult;
function authWithInfo(infoStr: string): Promise<AlipayResult>;

// 设置沙箱模式
function setAlipaySandbox(isSandbox: boolean): void

function pay(infoStr: string): IResult;
function pay(infoStr: string): Promise<AlipayResult>;

function payInterceptorWithUrl(infoStr: string): {
resultCode: TStatus;
function payInterceptorWithUrl(infoStr: string): Promise<{
resultCode: AlipayResultCode;
returnUrl: string;
};
}>;

function sign(infoStr: string): string;
}

export = Alipay;
export = Alipay;