type: 更新类型文件。
This commit is contained in:
41
index.d.ts
vendored
41
index.d.ts
vendored
@@ -4,6 +4,7 @@
|
|||||||
* 支付宝回调结果, 详情见 https://docs.open.alipay.com/204/105301
|
* 支付宝回调结果, 详情见 https://docs.open.alipay.com/204/105301
|
||||||
*/
|
*/
|
||||||
export interface AliOrderResult {
|
export interface AliOrderResult {
|
||||||
|
alipay_trade_app_pay_response: {
|
||||||
/**
|
/**
|
||||||
* 长度:64,商户网站唯一订单号 70501111111S001111119
|
* 长度:64,商户网站唯一订单号 70501111111S001111119
|
||||||
*/
|
*/
|
||||||
@@ -40,15 +41,53 @@ export interface AliOrderResult {
|
|||||||
* 长度:16,结果码 具体见公共错误码
|
* 长度:16,结果码 具体见公共错误码
|
||||||
*/
|
*/
|
||||||
code: string;
|
code: string;
|
||||||
|
},
|
||||||
|
sign: string;
|
||||||
|
sign_type: 'RSA2' | 'RSA';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
interface Resule {
|
||||||
|
/**
|
||||||
|
* "Error Domain=系统繁忙,请稍后再试 Code=1000 "(null)""
|
||||||
|
* 优惠券备注信息
|
||||||
|
*/
|
||||||
|
memo: string;
|
||||||
|
result?: string;
|
||||||
|
/**
|
||||||
|
* 9000 订单支付成功
|
||||||
|
* 8000 正在处理中,支付结果未知(有可能已经支付成功),请查询商户订单列表中订单的支付状态
|
||||||
|
* 4000 订单支付失败
|
||||||
|
* 5000 重复请求
|
||||||
|
* 6001 用户中途取消
|
||||||
|
* 6002 网络连接出错
|
||||||
|
* 6004 支付结果未知(有可能已经支付成功),请查询商户订单列表中订单的支付状态
|
||||||
|
* 其它 其它支付错误
|
||||||
|
*/
|
||||||
|
resultStatus?: '9000' | '8000' | '4000' | '5000' | '6001' | '6002' | '6004' | string;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 错误返回
|
||||||
|
// {
|
||||||
|
// 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: ''
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
export const Alipay: {
|
export const Alipay: {
|
||||||
/**
|
/**
|
||||||
* @param payInfo 支付详情
|
* @param payInfo 支付详情
|
||||||
* @param result 支付宝回调结果
|
* @param result 支付宝回调结果
|
||||||
*/
|
*/
|
||||||
alipay: (payInfo: string, callback?: (result: AliOrderResult) => void) => void;
|
alipay: (payInfo: string, callback?: (result: Resule) => void) => void;
|
||||||
/**
|
/**
|
||||||
* 设置支付宝跳转Scheme,仅 iOS
|
* 设置支付宝跳转Scheme,仅 iOS
|
||||||
* @param scheme scheme = `ap` + `APPID`
|
* @param scheme scheme = `ap` + `APPID`
|
||||||
|
@@ -34,12 +34,12 @@ RCT_EXPORT_MODULE()
|
|||||||
self->alipayCallBack([[NSArray alloc] initWithObjects:resultDic, nil]);
|
self->alipayCallBack([[NSArray alloc] initWithObjects:resultDic, nil]);
|
||||||
self->alipayCallBack = nil;
|
self->alipayCallBack = nil;
|
||||||
}
|
}
|
||||||
NSLog(@"result = %@",resultDic);
|
NSLog(@"result-->1 = %@",resultDic);
|
||||||
}];
|
}];
|
||||||
|
|
||||||
// 授权跳转支付宝钱包进行支付,处理支付结果
|
// 授权跳转支付宝钱包进行支付,处理支付结果
|
||||||
[[AlipaySDK defaultService] processAuth_V2Result:aURL standbyCallback:^(NSDictionary *resultDic) {
|
[[AlipaySDK defaultService] processAuth_V2Result:aURL standbyCallback:^(NSDictionary *resultDic) {
|
||||||
NSLog(@"result = %@",resultDic);
|
NSLog(@"result-->2 = %@", resultDic);
|
||||||
// 解析 auth code
|
// 解析 auth code
|
||||||
NSString *result = resultDic[@"result"];
|
NSString *result = resultDic[@"result"];
|
||||||
NSString *authCode = nil;
|
NSString *authCode = nil;
|
||||||
|
Reference in New Issue
Block a user