支付宝回调
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication
annotation:(id)annotation{
f ([[url scheme] isEqualToString:@"zhifubao.com"]) {
if ([url.host isEqualToString:@"safepay"]) {
[[AlipaySDK defaultService] processAuthResult:url standbyCallback:^(NSDictionary *resultDic) {
if (9000 == [[resultDic objectForKey:@"resultStatus"] intValue]) {
}
}];
}
}
2.在你调用的地方加入这句话 返回支付结果是个字典
[[AlipaySDK defaultService] payOrder:alpay.orderString fromScheme:appScheme callback:^(NSDictionary *resultDic) {
NSLog(@"支付结果!!!reslut = %@",resultDic);
if ([resultDic objectForKey:@"success"] != nil) {
[[NSNotificationCenter defaultCenter] postNotificationName:@"pay" object:@"支付成功"];
}else{
[[NSNotificationCenter defaultCenter] postNotificationName:@"pay" object:@"支付失败"];
}
}];