iOS 支付宝接入报错

来源:互联网 发布:全包半包和清包 知乎 编辑:程序博客网 时间:2024/05/18 00:25

一、编译报错

1、Cannot find interface declaration for ‘NSObject’, superclass of ‘Base64’
那么需要打开报错了的文件,增加头文件。

#import <Foundation/Foundation.h>

2、”openssl/asn1.h” file not found

点击项目名称,点击“Build Settings”选项卡,在搜索框中,以关键字“search”搜索,对“Header Search
Paths”增加头文件路径:$(SRCROOT)/文件相对路径。如果头文件信息已增加,可不必再增加。

温馨提示:“文件相对路径”指libcrypto.a 和 libssl.a所在的项目中的相对文件路径。比如我项目工程中libcrypto.a和 libssl.a放的位置为“TestAlipay/Alipay”,那我的头文件路径就是:$(SRCROOT)/TestAlipay/Alipay。

二、点击支付,不跳转

1、错误返回值:Error Domain=系统繁忙,请稍后再试 Code=1000 “The operation couldn’t be completed. (系统繁忙,请稍后再试 error 1000.)”

 //将商品信息赋予AlixPayOrder的成员变量    Order *order = [[Order alloc] init];    order.partner = partner;    order.seller = seller;    order.tradeNO = @"123456789";    order.productName = @"测试支付标题"; //商品标题    order.productDescription = @"测试支付描述"; //商品描述    order.amount = [NSString stringWithFormat:@"%.2f",200.0]; //商品价格    order.notifyURL =  @"http://krdong.weixinmob.com/alipay"; //回调URL    order.service = @"mobile.securitypay.pay";    order.paymentType = @"1";    order.inputCharset = @"utf-8";    order.itBPay = @"30m";    order.showUrl = @"m.alipay.com";

可能原因:
(1)order.seller为空;
(2)order.amount金额格式不对,最多可以精确到分,保留两位小数。(%.2f)

0 0
原创粉丝点击