国产探花免费观看_亚洲丰满少妇自慰呻吟_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; } }}

}


上一篇:環信集成錯誤

下一篇:定時任務組件

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 虞城县| 运城市| 方正县| 全南县| 宜春市| 泽库县| 六安市| 小金县| 赤城县| 安远县| 南木林县| 揭西县| 巴林左旗| 江北区| 白水县| 赤水市| 兰西县| 桃园县| 乐平市| 门源| 固阳县| 江油市| 龙海市| 中卫市| 栾城县| 石河子市| 武乡县| 朝阳县| 秀山| 华阴市| 钟祥市| 江永县| 彰武县| 兰坪| 无为县| 城口县| 临西县| 报价| 淮安市| 镇平县| 博兴县|