1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee
react-native-alipay/index.d.ts

103 lines
3.4 KiB
TypeScript
Raw Normal View History

2020-07-07 20:10:43 +08:00
/**
*
* , https://docs.open.alipay.com/204/105301
*/
export interface AliOrderResult {
2020-07-08 22:32:18 +08:00
alipay_trade_app_pay_response: {
/**
* 64 70501111111S001111119
*/
out_trade_no: string;
/**
* 6464 2014112400001000340011111118
*/
trade_no: string;
/**
* 32Id 2014072300007148
*/
app_id: string;
/**
* 9 RMB-Yuan[0.01,100000000.00] 9.00
*/
total_amount: number;
/**
* 16208816 20886894
*/
seller_id: string;
/**
* 16code返回结果的描述 success
*/
msg: string;
/**
* 16 utf-8
*/
charset: string;
/**
* 32 2016-10-11 17:43:36
*/
timestamp: string;
/**
* 16
*/
code: string;
},
sign: string;
sign_type: 'RSA2' | 'RSA';
}
interface Resule {
2020-07-07 20:57:23 +08:00
/**
2020-07-08 22:32:18 +08:00
* "Error Domain=系统繁忙,请稍后再试 Code=1000 "(null)""
*
2020-07-07 20:57:23 +08:00
*/
2020-07-08 22:32:18 +08:00
memo: string;
result?: string;
2020-07-07 20:57:23 +08:00
/**
2020-07-08 22:32:18 +08:00
* 9000
* 8000
* 4000
* 5000
* 6001
* 6002
* 6004
*
2020-07-07 20:57:23 +08:00
*/
2020-07-08 22:32:18 +08:00
resultStatus?: '9000' | '8000' | '4000' | '5000' | '6001' | '6002' | '6004' | string;
2020-07-07 20:10:43 +08:00
}
2020-07-08 22:32:18 +08:00
// 错误返回
// {
// memo: "Error Domain=系统繁忙,请稍后再试 Code=1000 \"(null)\"",
// result: "",
// resultStatus: "4000",
// }
// 成功返回
// {
// result: '{"alipay_trade_app_pay_response":{"code":"10000","msg":"Success","app_id":"2021001172656340","auth_app_id":"2021001172656340","charset":"UTF-8","timestamp":"2020-07-08 21:30:14","out_trade_no":"123123213123214","total_amount":"0.01","trade_no":"2020070822001414841426413774","seller_id":"2088421915791034"},"sign":"LY7wCsNLp+QnDqCq6VelY/RvyK7ZGY8wsXoKvS+Or7JjONLDUx5P6lDgqRKkpkng7br3y6GZzfGKaZ88Tf4eMnBMKyqU+huR2Um47xUxP383njvHlxuQZsSTLQZRswy4wmb/fPkFfvyH6Or6+oj0eboePOTu63bNr+h03w0QnP4znuHpfRuoVgWpsYh/6B1DL+4xfWRKJ21zm1SV9Feo9RWqnyTaGZyFVi6IKge0dUCYs9hXju95fOUVUOx5YflOFtSEnZafY9Ls4FCRQE1ANkjaKiKIE0+c4c4sEVEf/9Dwh88N+aSQOoLT+AV4RpjMoA8hF2k+vv2OKNeqr6SYGQ==","sign_type":"RSA2"}',
// resultStatus: '9000',
// memo: ''
// }
2020-07-07 20:10:43 +08:00
export const Alipay: {
/**
* @param payInfo
* @param result
*/
2020-07-08 22:32:18 +08:00
alipay: (payInfo: string, callback?: (result: Resule) => void) => void;
2020-07-07 20:10:43 +08:00
/**
* Scheme iOS
* @param scheme scheme = `ap` + `APPID`
*/
setAlipayScheme: (scheme: string) => void;
2020-07-08 10:21:49 +08:00
/**
* Android
* @param isSandBox
*/
setAlipaySandbox: (isSandbox: boolean) => void;
2020-07-07 20:10:43 +08:00
};
export default Alipay;