feat: 添加支付宝SDK
83
ios/Alipay.m
@@ -1,13 +1,90 @@
|
||||
#import "Alipay.h"
|
||||
#import <AlipaySDK/AlipaySDK.h>
|
||||
|
||||
@implementation Alipay
|
||||
{
|
||||
NSString *alipayScheme;
|
||||
RCTResponseSenderBlock alipayCallBack;
|
||||
}
|
||||
|
||||
RCT_EXPORT_MODULE()
|
||||
|
||||
RCT_EXPORT_METHOD(sampleMethod:(NSString *)stringArgument numberParameter:(nonnull NSNumber *)numberArgument callback:(RCTResponseSenderBlock)callback)
|
||||
- (instancetype)init
|
||||
{
|
||||
// TODO: Implement some actually useful functionality
|
||||
callback(@[[NSString stringWithFormat: @"numberArgument: %@ stringArgument: %@", numberArgument, stringArgument]]);
|
||||
self = [super init];
|
||||
if (self) {
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleOpenURL:) name:@"RCTOpenURLNotification" object:nil];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
}
|
||||
|
||||
- (BOOL)handleOpenURL:(NSNotification *)aNotification
|
||||
{
|
||||
NSString * aURLString = [aNotification userInfo][@"url"];
|
||||
NSURL * aURL = [NSURL URLWithString:aURLString];
|
||||
if ([aURL.host isEqualToString:@"safepay"]) {
|
||||
// 支付跳转支付宝钱包进行支付,处理支付结果
|
||||
[[AlipaySDK defaultService] processOrderWithPaymentResult:aURL standbyCallback:^(NSDictionary *resultDic) {
|
||||
if (self->alipayCallBack != nil) {
|
||||
self->alipayCallBack([[NSArray alloc] initWithObjects:resultDic, nil]);
|
||||
self->alipayCallBack = nil;
|
||||
}
|
||||
NSLog(@"result = %@",resultDic);
|
||||
}];
|
||||
|
||||
// 授权跳转支付宝钱包进行支付,处理支付结果
|
||||
[[AlipaySDK defaultService] processAuth_V2Result:aURL standbyCallback:^(NSDictionary *resultDic) {
|
||||
NSLog(@"result = %@",resultDic);
|
||||
// 解析 auth code
|
||||
NSString *result = resultDic[@"result"];
|
||||
NSString *authCode = nil;
|
||||
if (result.length>0) {
|
||||
NSArray *resultArr = [result componentsSeparatedByString:@"&"];
|
||||
for (NSString *subResult in resultArr) {
|
||||
if (subResult.length > 10 && [subResult hasPrefix:@"auth_code="]) {
|
||||
authCode = [subResult substringFromIndex:10];
|
||||
break;
|
||||
}
|
||||
}
|
||||
// 返回结果回调
|
||||
if (self->alipayCallBack != nil) {
|
||||
self->alipayCallBack([[NSArray alloc] initWithObjects:resultArr, nil]);
|
||||
self->alipayCallBack = nil;
|
||||
}
|
||||
}
|
||||
NSLog(@"授权结果 authCode = %@", authCode?:@"");
|
||||
}];
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
|
||||
RCT_EXPORT_METHOD(setAlipayScheme:(NSString *)scheme){
|
||||
alipayScheme = scheme;
|
||||
}
|
||||
RCT_EXPORT_METHOD(alipay:(NSString *)info callback:(RCTResponseSenderBlock)callback)
|
||||
{
|
||||
alipayCallBack = callback;
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[[AlipaySDK defaultService] payOrder:info fromScheme:alipayScheme callback:^(NSDictionary *resultDic) {
|
||||
NSLog(@"alipay:callback");
|
||||
|
||||
callback([[NSArray alloc] initWithObjects:resultDic, nil]);
|
||||
}];
|
||||
});
|
||||
}
|
||||
|
||||
/*!
|
||||
* [warn][tid:main][RCTModuleData.mm:68] Module Alipay requires main queue setup since it overrides `init` but doesn't implement `requiresMainQueueSetup`.
|
||||
* In a future release React Native will default to initializing all native modules on a background thread unless explicitly opted-out of.
|
||||
*/
|
||||
+ (BOOL)requiresMainQueueSetup
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -6,6 +6,10 @@
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
B954DB6F24B48377005C7268 /* AlipaySDK in Frameworks */ = {isa = PBXBuildFile; fileRef = B954DB6E24B48377005C7268 /* AlipaySDK */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
58B511D91A9E6C8500147676 /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
@@ -20,6 +24,8 @@
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
134814201AA4EA6300B7C361 /* libAlipay.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libAlipay.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
B954DB6C24B48352005C7268 /* AlipaySDK.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = AlipaySDK.bundle; sourceTree = "<group>"; };
|
||||
B954DB6E24B48377005C7268 /* AlipaySDK */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; name = AlipaySDK; path = AlipaySDK.framework/AlipaySDK; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@@ -27,6 +33,7 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
B954DB6F24B48377005C7268 /* AlipaySDK in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -45,9 +52,19 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
134814211AA4EA7D00B7C361 /* Products */,
|
||||
B954DB6B24B48352005C7268 /* Frameworks */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
B954DB6B24B48352005C7268 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
B954DB6E24B48377005C7268 /* AlipaySDK */,
|
||||
B954DB6C24B48352005C7268 /* AlipaySDK.bundle */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
|
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
BIN
ios/AlipaySDK.bundle/alipay_msp_back@2x.png
Normal file
After Width: | Height: | Size: 409 B |
BIN
ios/AlipaySDK.bundle/alipay_msp_refresh@2x.png
Normal file
After Width: | Height: | Size: 663 B |
BIN
ios/AlipaySDK.bundle/bar@2x.png
Normal file
After Width: | Height: | Size: 1011 B |
1
ios/AlipaySDK.bundle/bridge.js
Normal file
@@ -0,0 +1 @@
|
||||
!function(){if(!window.AlipayJSBridge){window.alipayjsbridgeSetTitle=function(e){document.title=e,t("alipayjsbridge://setTitle?title="+encodeURIComponent(e))},window.alipayjsbridgeRefresh=function(){t("alipayjsbridge://onRefresh?")},window.alipayjsbridgeBack=function(){t("alipayjsbridge://onBack?")},window.alipayjsbridgeExit=function(e){t("alipayjsbridge://onExit?bsucc="+e)},window.alipayjsbridgeShowBackButton=function(e){t("alipayjsbridge://showBackButton?bshow="+e)},window.AlipayJSBridge={version:"2.0",addListener:function(e,i){a[e]=i},hasListener:function(e){if(!a[e])return!1;return!0},callListener:function(e,i,n){var t;n&&(t=function(e){var i="";e&&(i=encodeURIComponent(JSON.stringify(e)));var a="func=h5JsFuncCallback&cbId="+n+"&data="+i;o(a)});var r=a[e];r?r(i,t):console.log("AlipayJSBridge: no h5JsFunc ",e+i)},callNativeFunc:function(e,a,t){var r="";t&&(r="cb_"+i+++"_"+(new Date).getTime(),n[r]=t);var d="";a&&(d=encodeURIComponent(JSON.stringify(a)));o("func="+e+"&cbId="+r+"&data="+d)},callBackFromNativeFunc:function(e,i){var a=n[e];a&&(a(i),delete n[i])}};var e,i=1,n={},a={};window.CustomEvent?e=new CustomEvent("alipayjsbridgeready"):(e=document.createEvent("Event")).initEvent("alipayjsbridgeready",!0,!0),document.dispatchEvent(e),setTimeout(function(){if(window.AlipayJSBridgeInitArray){var e=window.AlipayJSBridgeInitArray;delete window.AlipayJSBridgeInitArray;for(var i=0;i<e.length;i++)try{e[i](AlipayJSBridge)}catch(e){setTimeout(function(){throw e})}}},0)}function t(e){window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.MQPJSBridgeScheme&&window.webkit.messageHandlers.MQPJSBridgeScheme.postMessage&&window.webkit.messageHandlers.MQPJSBridgeScheme.postMessage(e)}function o(e){t("alipayjsbridge://callNativeFunc?"+e)}}();
|
BIN
ios/AlipaySDK.bundle/refresh@2x.png
Normal file
After Width: | Height: | Size: 605 B |
BIN
ios/AlipaySDK.bundle/refresh_click@2x.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
ios/AlipaySDK.bundle/shutdown@2x.png
Normal file
After Width: | Height: | Size: 222 B |
BIN
ios/AlipaySDK.bundle/shutdown_click@2x.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
ios/AlipaySDK.framework/AlipaySDK
Normal file
BIN
ios/AlipaySDK.framework/AlipaySDK-inside-Info.plist
Normal file
56
ios/AlipaySDK.framework/Headers/AFServiceCenter.h
Normal file
@@ -0,0 +1,56 @@
|
||||
//
|
||||
// AFServiceCenter.h
|
||||
// AFServiceSDK
|
||||
//
|
||||
// Created by jiajunchen on 02/01/2018.
|
||||
// Copyright © 2018 antfin. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class AFServiceResponse;
|
||||
|
||||
/**
|
||||
SDK支持的业务枚举值
|
||||
|
||||
- AFServiceEInvoice: 电子发票
|
||||
- AFServiceAuth: 账户授权
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, AFService) {
|
||||
AFServiceEInvoice,
|
||||
AFServiceAuth,
|
||||
AFServiceDeduct
|
||||
};
|
||||
|
||||
|
||||
extern NSString * const kAFServiceOptionBizParams; // 钱包服务调用入参
|
||||
extern NSString * const kAFServiceOptionCallbackScheme; // 业务回跳当前app的scheme
|
||||
extern NSString * const kAFServiceOptionNotUseLanding; // 不使用支付宝提示下载页做补偿,为true时需要商户自己处理用户未安装支付宝的情况
|
||||
extern NSString * const kAFServiceBizParamsKeyUrl; // 独立签约入参url
|
||||
|
||||
typedef void(^AFServiceResultBlock)(AFServiceResponse *response);
|
||||
|
||||
@interface AFServiceCenter : NSObject
|
||||
|
||||
/**
|
||||
调用钱包服务
|
||||
|
||||
@param service 业务service, 见AFService枚举值
|
||||
@param params 参数Dictionary, key值详情参见kAFServiceOptionBizParams、kAFServiceOptionCallbackScheme注释
|
||||
@param block 业务结果回调的block, block参数是AFServiceResponse类型,业务结果通过result属性获取,如果未用户未安装支付宝并且kAFServiceOptionNotUseLanding未设置为true,会使用H5landing页做补偿,这种情况下不会有block回调结果。
|
||||
*/
|
||||
+ (void)callService:(AFService)service
|
||||
withParams:(NSDictionary *)params
|
||||
andCompletion:(AFServiceResultBlock)block;
|
||||
|
||||
|
||||
/**
|
||||
处理钱包服务回跳APP的URL
|
||||
|
||||
@param url 回跳URL
|
||||
@param block 业务结果回掉的block,详情见调用接口入参上的block。注意此接口上的block只有在跳转钱包后,当前APP被系统回收的情况下回跳才生效
|
||||
*/
|
||||
+ (void)handleResponseURL:(NSURL *)url
|
||||
withCompletion:(AFServiceResultBlock)block;
|
||||
|
||||
@end
|
43
ios/AlipaySDK.framework/Headers/AFServiceResponse.h
Normal file
@@ -0,0 +1,43 @@
|
||||
//
|
||||
// AFServiceResponse.h
|
||||
// AFServiceSDK
|
||||
//
|
||||
// Created by jiajunchen on 08/01/2018.
|
||||
// Copyright © 2018 antfin. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
/**
|
||||
钱包服务调用结果状态吗
|
||||
|
||||
- AFResSuccess: 默认值,业务调用成功,结果数据参见result字段
|
||||
- AFResInvalidService: service枚举值错误
|
||||
- AFResInvalidURL: 钱包回跳URL错误
|
||||
- AFResRepeatCall: 业务重复调用(3s内)
|
||||
- AFResOpenURLErr: 跳转失败
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, AFResCode) {
|
||||
AFResSuccess = 0,
|
||||
AFResInvalidService = 100,
|
||||
AFResInvalidURL,
|
||||
AFResRepeatCall,
|
||||
AFResOpenURLErr,
|
||||
};
|
||||
|
||||
|
||||
@interface AFServiceResponse : NSObject
|
||||
|
||||
|
||||
/**
|
||||
业务调用状态吗
|
||||
*/
|
||||
@property (nonatomic, assign) AFResCode responseCode;
|
||||
|
||||
|
||||
/**
|
||||
业务结果Dictionary, 内容请参考具体业务方接入文档
|
||||
*/
|
||||
@property (readonly) NSDictionary *result;
|
||||
|
||||
@end
|
33
ios/AlipaySDK.framework/Headers/APayAuthInfo.h
Normal file
@@ -0,0 +1,33 @@
|
||||
//
|
||||
// APAuthInfo.h
|
||||
// APAuth
|
||||
//
|
||||
// Created by antfin on 17-10-24.
|
||||
// Copyright (c) 2017年 AntFin. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface APayAuthInfo : NSObject
|
||||
|
||||
@property(nonatomic, copy)NSString *appID;
|
||||
@property(nonatomic, copy)NSString *pid;
|
||||
@property(nonatomic, copy)NSString *redirectUri;
|
||||
|
||||
/**
|
||||
* 初始化AuthInfo
|
||||
*
|
||||
* @param appIDStr 应用ID
|
||||
* @param pidStr 商户ID 可不填
|
||||
* @param uriStr 授权的应用回调地址 比如:alidemo://auth
|
||||
*
|
||||
* @return authinfo实例
|
||||
*/
|
||||
- (id)initWithAppID:(NSString *)appIDStr
|
||||
pid:(NSString *)pidStr
|
||||
redirectUri:(NSString *)uriStr;
|
||||
|
||||
- (NSString *)description;
|
||||
- (NSString *)wapDescription;
|
||||
|
||||
@end
|
223
ios/AlipaySDK.framework/Headers/AlipaySDK.h
Normal file
@@ -0,0 +1,223 @@
|
||||
//
|
||||
// AlipaySDK.h
|
||||
// AlipaySDK
|
||||
//
|
||||
// Created by antfin on 17-10-24.
|
||||
// Copyright (c) 2017年 AntFin. All rights reserved.
|
||||
//
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
///////////////// 支付宝标准版本支付SDK ///////////////////
|
||||
///////// version:15.7.7 motify:2020.07.02///////////
|
||||
////////////////////////////////////////////////////////
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "APayAuthInfo.h"
|
||||
#import "AFServiceCenter.h"
|
||||
#import "AFServiceResponse.h"
|
||||
|
||||
typedef void(^CompletionBlock)(NSDictionary *resultDic);
|
||||
|
||||
typedef enum {
|
||||
ALIPAY_TIDFACTOR_IMEI,
|
||||
ALIPAY_TIDFACTOR_IMSI,
|
||||
ALIPAY_TIDFACTOR_TID,
|
||||
ALIPAY_TIDFACTOR_CLIENTKEY,
|
||||
ALIPAY_TIDFACTOR_VIMEI,
|
||||
ALIPAY_TIDFACTOR_VIMSI,
|
||||
ALIPAY_TIDFACTOR_CLIENTID,
|
||||
ALIPAY_TIDFACTOR_APDID,
|
||||
ALIPAY_TIDFACTOR_MAX
|
||||
} AlipayTidFactor;
|
||||
|
||||
@interface AlipaySDK : NSObject
|
||||
|
||||
/**
|
||||
* 创建支付单例服务
|
||||
*
|
||||
* @return 返回单例对象
|
||||
*/
|
||||
+ (AlipaySDK *)defaultService;
|
||||
|
||||
/**
|
||||
* 用于设置SDK使用的window,如果没有自行创建window无需设置此接口
|
||||
*/
|
||||
@property (nonatomic, weak) UIWindow *targetWindow;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////支付宝支付相关接口/////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* 支付接口
|
||||
*
|
||||
* @param orderStr 支付订单信息字串
|
||||
* @param schemeStr 调用支付的app注册在info.plist中的scheme
|
||||
* @param completionBlock 支付结果回调Block,用于wap支付结果回调
|
||||
跳转支付宝支付时只有当processOrderWithPaymentResult接口的completionBlock为nil时会使用这个bolock
|
||||
*/
|
||||
- (void)payOrder:(NSString *)orderStr
|
||||
fromScheme:(NSString *)schemeStr
|
||||
callback:(CompletionBlock)completionBlock;
|
||||
|
||||
/**
|
||||
* 支付接口 v2
|
||||
*
|
||||
* @param orderStr 支付订单信息字串
|
||||
* @param dynamicLaunch 是否使用动态配置策略跳转支付宝支付
|
||||
* @param schemeStr 调用支付的app注册在info.plist中的scheme
|
||||
* @param completionBlock 支付结果回调Block,用于wap支付结果回调
|
||||
跳转支付宝支付时只有当processOrderWithPaymentResult接口的completionBlock为nil时会使用这个bolock
|
||||
*/
|
||||
- (void)payOrder:(NSString *)orderStr
|
||||
dynamicLaunch:(BOOL)dynamicLaunch
|
||||
fromScheme:(NSString *)schemeStr
|
||||
callback:(CompletionBlock)completionBlock;
|
||||
|
||||
/**
|
||||
* 处理支付宝app支付后跳回商户app携带的支付结果Url
|
||||
*
|
||||
* @param resultUrl 支付宝app返回的支付结果url
|
||||
* @param completionBlock 支付结果回调 为nil时默认使用支付接口的completionBlock
|
||||
*/
|
||||
- (void)processOrderWithPaymentResult:(NSURL *)resultUrl
|
||||
standbyCallback:(CompletionBlock)completionBlock;
|
||||
|
||||
/**
|
||||
* 获取交易token。
|
||||
*
|
||||
* @return 交易token,若无则为空。
|
||||
*/
|
||||
- (NSString *)fetchTradeToken;
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////支付宝授权 2.0 相关接口////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* 快登授权2.0
|
||||
*
|
||||
* @param infoStr 授权请求信息字串
|
||||
* @param schemeStr 调用授权的app注册在info.plist中的scheme
|
||||
* @param completionBlock 授权结果回调,需要调用方在appDelegate中调用processAuth_V2Result:standbyCallback:方法获取授权结果
|
||||
* 若在授权过程中,调用方应用被系统终止则此block无效(此时会调用'processAuth_V2Result:standbyCallback:'传入的standbyCallback)
|
||||
*/
|
||||
- (void)auth_V2WithInfo:(NSString *)infoStr
|
||||
fromScheme:(NSString *)schemeStr
|
||||
callback:(CompletionBlock)completionBlock;
|
||||
|
||||
/**
|
||||
* 处理支付宝app授权后跳回商户app携带的授权结果Url
|
||||
*
|
||||
* @param resultUrl 支付宝app返回的授权结果url
|
||||
* @param completionBlock 授权结果回调,用于处理跳转支付宝授权过程中商户APP被系统终止的情况
|
||||
*/
|
||||
- (void)processAuth_V2Result:(NSURL *)resultUrl
|
||||
standbyCallback:(CompletionBlock)completionBlock;
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////支付宝授权 1.0 相关接口////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/**
|
||||
* 快登授权
|
||||
* @param authInfo 授权相关信息
|
||||
* @param completionBlock 授权结果回调,若在授权过程中,调用方应用被系统终止,则此block无效,
|
||||
需要调用方在appDelegate中调用processAuth_V2Result:standbyCallback:方法获取授权结果
|
||||
*/
|
||||
- (void)authWithInfo:(APayAuthInfo *)authInfo
|
||||
callback:(CompletionBlock)completionBlock;
|
||||
|
||||
/**
|
||||
* 处理支付宝app授权后跳回商户app携带的授权结果Url
|
||||
*
|
||||
* @param resultUrl 支付宝app返回的授权结果url
|
||||
* @param completionBlock 授权结果回调
|
||||
*/
|
||||
- (void)processAuthResult:(NSURL *)resultUrl
|
||||
standbyCallback:(CompletionBlock)completionBlock;
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////支付宝 h5 支付转 native 支付接口////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
* 从h5链接中获取订单串并支付接口(自版本15.4.0起,推荐使用该接口)
|
||||
*
|
||||
* @param urlStr 拦截的 url string
|
||||
*
|
||||
* @return YES为成功获取订单信息并发起支付流程;NO为无法获取订单信息,输入url是普通url
|
||||
*/
|
||||
- (BOOL)payInterceptorWithUrl:(NSString *)urlStr
|
||||
fromScheme:(NSString *)schemeStr
|
||||
callback:(CompletionBlock)completionBlock;
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////支付宝 tid 相关信息获取接口/////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* 获取当前tid相关信息
|
||||
*
|
||||
* @return tid相关信息
|
||||
*/
|
||||
- (NSString*)queryTidFactor:(AlipayTidFactor)factor;
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////支付宝支付环境相关信息接口//////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* 是否已经使用过
|
||||
*
|
||||
* @return YES为已经使用过,NO反之
|
||||
*/
|
||||
- (BOOL)isLogined;
|
||||
|
||||
/**
|
||||
* 获取当前版本号
|
||||
*
|
||||
* @return 当前版本字符串
|
||||
*/
|
||||
- (NSString *)currentVersion;
|
||||
|
||||
/**
|
||||
* 測試所用,realse包无效
|
||||
*
|
||||
* @param url 测试环境
|
||||
*/
|
||||
- (void)setUrl:(NSString *)url;
|
||||
|
||||
/**
|
||||
* 支付前主动更新本地配置
|
||||
*
|
||||
* @param block 更新请求结果回调
|
||||
*/
|
||||
- (void)fetchSdkConfigWithBlock:(void(^)(BOOL success))block;
|
||||
|
||||
|
||||
typedef void(^APLogBlock)(NSString *log);
|
||||
|
||||
/**
|
||||
* 接收AlipaySDK的log信息
|
||||
*
|
||||
* @param logBlock 打印log的回调block
|
||||
*/
|
||||
+ (void)startLogWithBlock:(APLogBlock)logBlock;
|
||||
|
||||
/**
|
||||
* 停止输出log,会释放logBlock
|
||||
*
|
||||
*
|
||||
*/
|
||||
+ (void)stopLog;
|
||||
|
||||
@end
|