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

首頁 > 學院 > 開發設計 > 正文

關于支付的回調處理

2019-11-09 17:05:08
字體:
來源:轉載
供稿:網友

此處拿微信支付來舉例,支付寶支付同理 添加WXApiDelegate //不同iOS版本的回調函數不同,但也大同小異,具體不再列舉。 - (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]; } } 只有實現了上述回調才會返回對應的支付結果 -(void) onResp: (BaseResp* )resp { NSString *strMsg = [NSString stringWithFormat: @”errcode: %d”, resp.errCode]; NSString *strTitle;

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

}


上一篇:環信集成錯誤

下一篇:定時任務組件

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 青州市| 弥渡县| 屏南县| 古丈县| 远安县| 仙居县| 礼泉县| 胶州市| 宁夏| 嘉荫县| 曲周县| 平山县| 闵行区| 项城市| 屏山县| 永新县| 利津县| 藁城市| 缙云县| 花垣县| 惠州市| 龙门县| 昔阳县| 宁南县| 金门县| 四子王旗| 卫辉市| 南丰县| 福海县| 江山市| 蕲春县| 思南县| 白朗县| 灵川县| 定远县| 洛宁县| 克拉玛依市| 利津县| 郴州市| 建水县| 盘锦市|