文章来源:淘论文网   发布者: 毕业设计   浏览量: 58



还可以点击去查询以下关键词:
[移动]    [支付]    [移动支付]   

项目介绍:


         

github地址 https://github.com/SMARTSMALL/MobilePayDemo


URL Schemes 配置如下


移动支代写付




info.plist 白名单配置及网络配置


移动支代写付



移动支代写付



ps. 支付集成及注意事项 均在LZMobilePayManager.h中 有提到


/************支付宝支付****************/

/*

1.导入(AlipaySDK.bundle AlipaySDK.framework)到项目文件库下

2.在Build Phases选项卡的Link Binary With Libraries中,增加以下依赖:libc++.tbd、libz.tbd、SystemConfiguration.framework、CoreTelephony.framework、QuartzCore.framework、CoreText.framework、CoreGraphics.framework、UIKit.framework、Foundation.framework、CFNetwork.framework、CoreMotion.framework、AlipaySDK.framework

3.导入#import

- (BOOL)applicationUIApplication *)application

openURLNSURL *)url

sourceApplicationNSString *)sourceApplication

annotationid)annotation {

if ([url.host isEqualToString'safepay']) {

//支付跳转支付宝钱包进行支付,处理支付结果

[[AlipaySDK defaultService] processOrderWithPaymentResult:url standbyCallback:^(NSDictionary *resultDic) {

NSLog(@'result = %@',resultDic);

if (resultDic) {

[[NSNotificationCenter defaultCenter]postNotificationName'AlipayNotification' object:selfuserInfo:resultDic];

}

}];

//授权跳转支付宝钱包进行支付,处理支付结果

[[AlipaySDK defaultService] processAuth_V2Result:url standbyCallback:^(NSDictionary *resultDic) {

NSLog(@'defaultService 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;

}

}

}

NSLog(@'授权结果authCode = %@', authCode?'');

}];

}

}

return YES;

}

// NOTE: 9.0以后使用新API接口

- (BOOL)applicationUIApplication *)app openURLNSURL *)url optionsNSDictionary *)options

{

//支付跳转支付宝钱包进行支付,处理支付结果

[[AlipaySDK defaultService] processOrderWithPaymentResult:url standbyCallback:^(NSDictionary *resultDic) {

if (resultDic) {

[[NSNotificationCenter defaultCenter]postNotificationName'AlipayNotification' object:selfuserInfo:resultDic];

}

NSLog(@'result = %@',resultDic);

}];

//授权跳转支付宝钱包进行支付,开题报告,处理支付结果

[[AlipaySDK defaultService] processAuth_V2Result:url standbyCallback:^(NSDictionary *resultDic) {

NSLog(@'defaultService==result = %@',resultDic);

//解析auth code

NSString *result = resultDic[@'result'];

NSString *authCode = nil;

if (result.length>0) {

NSArray *resultArr = [result componentsSeparatedByString'&'];

for (NSString *subResult in resultArr) {

#p#分页标题#e#

if (subResult.length > 10 && [subResult hasPrefix'auth_code=']) {

authCode = [subResult substringFromIndex:10];

break;

}

}

}

NSLog(@'授权结果authCode = %@', authCode?'');

}];

}

return YES;

}

4.、点击项目名称,点击“Info”选项卡,在“URL Types”选项中,点击“+”,在“URL Schemes”中输入“alisdkdemo”。“alisdkdemo”来自于文件“APViewController.m”的NSString *appScheme = @“alisdkdemo”;。

注意:这里的URL Schemes中输入的alisdkdemo,开题报告,为测试demo,实际商户的app中要填写独立的scheme,建议跟商户的app有一定的标示度,要做到和其他的商户app不重复,否则可能会导致支付宝返回的结果无法正确跳回商户app。

5.注意'openssl/asn1.h' file not found在Build Setting下Header search paths添加'$(SRCROOT)/工程名/文件夹'

6.注意如果出现【rsa_private read error : private key is NULL】

1.修改RSADataSigner中方法formatPrivateKey中

[result appendString'-----BEGIN PRIVATE KEY-----\n'];

[result appendString:@'\n-----END PRIVATE KEY-----'];

[result appendString:@'-----BEGIN RSA PRIVATE KEY-----\n'];

[result appendString:@'\n-----END RSA PRIVATE KEY-----'];

2.

检查提供是私钥是否正确*/

如何使用 LZMobilePayManager

移动支代写付


这里还有:


还可以点击去查询:
[移动]    [支付]    [移动支付]   

请扫码加微信 微信号:sj52abcd


下载地址: http://www.taolw.com/down/6896.docx
  • 上一篇:IOS11SytleT定制itleController
  • 下一篇:iOS scrollView嵌套tableView的手势冲突解决方案