微信支付gitub地址 https://github.com/zhuzhongshen/WechatPayManager
直接使用微信支付
//导入头文件
#import "WechatPayManager.h"
//配置微信支付
WechatPayManager * wxpayManager = [[WechatPayManager alloc]initWithAppID:kWEIXINID mchID:kWEIXINPartnerId spKey:KWXPartnerKey notifyUrl:kWEIXINNOTIFYURL];
//获取错误提示
NSString *debug = [wxpayManager getDebugInfo];
LRLog(@"微信支付debug===%@",debug);
//获取微信支付参数
NSMutableDictionary * params = [wxpayManager getPrepayWithOrderName:@"text" price:@"1"];
//调起微信支付
PayReq* req = [[PayReq alloc] init];
req.openID = [params objectForKey:@"appid"]; //微信开放平台审核通过的应用APPID
req.partnerId = [params objectForKey:@"partnerid"]; //微信支付分配的商户号
req.prepayId = [params objectForKey:@"prepayid"]; //微信返回的支付交易会话ID
req.nonceStr = [params objectForKey:@"noncestr"]; //随机字符串,不长于32位。推荐
req.timeStamp = [[params objectForKey:@"timestamp"] intValue]; //时间戳
req.package = @"Sign=WXPay"; //[dataDict objectForKey:@"package"];// Sign=WXPay
req.sign = [params objectForKey:@"sign"]; // 签名
[WXApi sendReq:req];