国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發(fā)設(shè)計 > 正文

關(guān)于支付的回調(diào)處理

2019-11-09 15:48:30
字體:
供稿:網(wǎng)友

此處拿微信支付來舉例,支付寶支付同理 添加WXApiDelegate //不同iOS版本的回調(diào)函數(shù)不同,但也大同小異,具體不再列舉。 - (BOOL)application: (UIApplication * )application openURL: (NSURL * )url sourceApplication: (NSString * )sourceApplication annotation: (id)annotation if ([WXApi handleOpenURL: url delegate:self]) { return [WXApi handleOpenURL: url delegate:self]; } } 只有實現(xiàn)了上述回調(diào)才會返回對應(yīng)的支付結(jié)果 -(void) onResp: (BaseResp* )resp { NSString *strMsg = [NSString stringWithFormat: @”errcode: %d”, resp.errCode]; NSString *strTitle;

if([resp isKindOfClass: [SendMessageToWXResp class]]){ strTitle = [NSString stringWithFormat: @"發(fā)送媒體消息結(jié)果"];}if([resp isKindOfClass: [PayResp class]]){ //支付返回結(jié)果,實際支付結(jié)果需要去微信服務(wù)器端查詢 strTitle = [NSString stringWithFormat: @"支付結(jié)果"]; switch (resp.errCode) { case WXSuccess: { strMsg = @"支付結(jié)果:成功!"; NSLog(@"支付成功-PaySuccess,retcode = %d", resp.errCode); NSNotification *notification = [NSNotification notificationWithName:ORDER_PAY_NOTIFICATION object: @"success"]; [[NSNotificationCenter defaultCenter] postNotification:notification]; break; } default: { strMsg = [NSString stringWithFormat: @"支付結(jié)果:失敗!retcode = %d, retstr = %@", resp.errCode,resp.errStr]; NSLog(@"錯誤,retcode = %d, retstr = %@", resp.errCode,resp.errStr); NSNotification *notification = [NSNotification notificationWithName:ORDER_PAY_NOTIFICATION object: @"fail"]; [[NSNotificationCenter defaultCenter] postNotification:notification]; break; } }}

}


發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 衡南县| 南平市| 道孚县| 琼结县| 乡宁县| 满城县| 礼泉县| 玉溪市| 北票市| 观塘区| 赤城县| 宜兰市| 汉寿县| 肇州县| 大丰市| 宁河县| 绵阳市| 肥东县| 张北县| 杨浦区| 凤山县| 克什克腾旗| 东阳市| 太原市| 土默特左旗| 顺昌县| 江源县| 诸城市| 英山县| 南岸区| 京山县| 绥化市| 崇信县| 攀枝花市| 万宁市| 乌苏市| 牡丹江市| 政和县| 陈巴尔虎旗| 五河县| 涞水县|