微信支付代码
//检查用户是否安装微信
if ([WXApi isWXAppInstalled]) {
/** 商家向财付通申请的商家id */
//partnerId;
/** 预支付订单 */
//prepayId;
/** 随机串,防重发 */
//nonceStr;
/** 时间戳,防重发 */
//timeStamp;
/** 商家根据财付通文档填写的数据和签名 */
//NSString *package;
/** 商家根据微信开放平台文档对数据做的签名 */
//NSString *sign;
//调起微信支付
PayReq* req = [[PayReq alloc] init];
req.partnerId = [dic objectForKey:@"partnerid"];
req.prepayId = [dic objectForKey:@"prepayid"];
req.nonceStr = [dic objectForKey:@"noncestr"];
req.timeStamp = [[dic objectForKey:@"timestamp"]intValue];
req.package = [dic objectForKey:@"packageValue"];
//req.openID = [dic objectForKey:@"appid"];
req.sign = [dic objectForKey:@"sign"];
[WXApi sendReq:req];
```
支付宝支付
//支付宝支付
//self.payInfo为服务器返给的支付字符串
[[AlipaySDK defaultService] payOrder:self.payInfo fromScheme:@"IShareHome" callback:^(NSDictionary *resultDic) {
NSLog(@"支付宝支付结果reslut = %@",resultDic);
}];
配置的话大家去官网看着配一下就ok了我就不啰嗦了