支付宝返回数据
reslut = { memo = ""; result = "partner=\"xxxxxxxxx\"&seller_id=\"[xxxxxxxxxx@qq.com](mailto:xxxxxxxxxx@qq.com)\"&out_trade_no=\"xxxxxxxxxx\"&subject=\"1\U5143\"&body=\"\U5145\U503c1\U5143\"&total_fee=\"0.01\"¬ify_url=\"http://www.xxx.com\"&service=\"mobile.securitypay.pay\"&payment_type=\"1\"&_input_charset=\"utf-8\"&it_b_pay=\"30m\"&show_url=\"m.alipay.com\"&success=\"true\"&sign_type=\"RSA\"&sign=\"xxxxxxxxxxxxxxxxxxx\""; resultStatus = 9000;}
只判断 resultStatus = 9000
[[AlipaySDK defaultService] processOrderWithPaymentResult:url standbyCallback:^(NSDictionary *resultDic) {
NSInteger orderState=[resultDic[@"resultStatus"]integerValue];
if (orderState==9000) {
NSString *allString=resultDic[@"result"];
NSString * FirstSeparateString=@"\"&";
NSString * SecondSeparateString=@"=\"";
NSMutableDictionary *dic=[CommonToolsVEComponentsStringToDic:allString withSeparateString:FirstSeparateString AndSeparateString:SecondSeparateString];
NSLog(@"ali=%@",dic);
if ([dic[@"success"]isEqualToString:@"true"]) {
[[NSNotificationCenter defaultCenter] postNotificationName:@"AliPaySucceed" object:nil userInfo:dic];
}
}else{
NSString *returnStr;
switch (orderState) {
case 8000:
returnStr=@"订单正在处理中";
break;
case 4000:
returnStr=@"订单支付失败";
break;
case 6001:
returnStr=@"订单取消";
break;
case 6002:
returnStr=@"网络连接出错";
break;
default:
break;
}
[HUDTooles showTextHUD:returnStr];
[HUDTooles removeHUD:4];
}
}];
网友评论