国产探花免费观看_亚洲丰满少妇自慰呻吟_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ā)表
主站蜘蛛池模板: 伊金霍洛旗| 红安县| 伊春市| 信阳市| 湘西| 云霄县| 合川市| 镇平县| 鸡东县| 吴江市| 敦化市| 阳东县| 马公市| 长治市| 宁津县| 曲松县| 札达县| 乡城县| 溆浦县| 衡东县| 蒲江县| 新邵县| 建德市| 龙里县| 祁连县| 偏关县| 阿尔山市| 东至县| 庄河市| 宁河县| 乡宁县| 囊谦县| 赤壁市| 顺平县| 竹溪县| 大名县| 乌苏市| 隆化县| 盱眙县| 年辖:市辖区| 邻水|