Commit ea59aec8a718ffe79bdca157aaef06bef5673cde
1 parent
dfc22a0f
0.0.4
Showing
7 changed files
with
44 additions
and
18 deletions
CNLivePayCostModule.podspec
| @@ -8,7 +8,7 @@ | @@ -8,7 +8,7 @@ | ||
| 8 | 8 | ||
| 9 | Pod::Spec.new do |s| | 9 | Pod::Spec.new do |s| |
| 10 | s.name = 'CNLivePayCostModule' | 10 | s.name = 'CNLivePayCostModule' |
| 11 | - s.version = '0.0.3' | 11 | + s.version = '0.0.4' |
| 12 | s.summary = 'A short description of CNLivePayCostModule.' | 12 | s.summary = 'A short description of CNLivePayCostModule.' |
| 13 | 13 | ||
| 14 | # This description is used to generate tags and improve search results. | 14 | # This description is used to generate tags and improve search results. |
CNLivePayCostModule/Classes/Core/CNLivePayCostHeader.h
| @@ -42,6 +42,8 @@ typedef enum { | @@ -42,6 +42,8 @@ typedef enum { | ||
| 42 | CNLivePayCostThreePayTypeScren = 2, //扫码支付 | 42 | CNLivePayCostThreePayTypeScren = 2, //扫码支付 |
| 43 | CNLivePayCostThreePayTypeTicke = 4, //门票支付 | 43 | CNLivePayCostThreePayTypeTicke = 4, //门票支付 |
| 44 | CNLivePayCostThreePayTypeSHSop = 5, //上海电商支付(自定义回调地址属性) | 44 | CNLivePayCostThreePayTypeSHSop = 5, //上海电商支付(自定义回调地址属性) |
| 45 | + CNLivePayCostThreePayTypeHTML = 6, //网页支付 | ||
| 46 | + CNLivePayCostThreePayTypeShop = 7, //电商支付(传参为全部自定义的) | ||
| 45 | } CNLivePayCostThreePayType; | 47 | } CNLivePayCostThreePayType; |
| 46 | 48 | ||
| 47 | 49 |
CNLivePayCostModule/Classes/Core/CNLivePayCostModule.m
| @@ -220,7 +220,7 @@ | @@ -220,7 +220,7 @@ | ||
| 220 | 220 | ||
| 221 | NSString * p = [NSString stringWithFormat:@"%d",(NSInteger)([price floatValue]*100)]; | 221 | NSString * p = [NSString stringWithFormat:@"%d",(NSInteger)([price floatValue]*100)]; |
| 222 | 222 | ||
| 223 | - [CNLivePayCostNetwork requestWithUMSPayForPrePayWithOrderId:orderId Body:body Price:p CouponFee:couponFee BalanceFee:balanceFee NotifyUrl:notifyUrl Type:payType FrmId:@"debug" PassWord:password CompleterBlcok:^(NSInteger statue) { | 223 | + [CNLivePayCostNetwork requestWithUMSPayForPrePayWithOrderId:orderId Body:body Price:p CouponFee:couponFee BalanceFee:balanceFee NotifyUrl:notifyUrl Type:payType ThreePayType:CNLivePayCostThreePayTypeShop FrmId:@"debug" PassWord:password CompleterBlcok:^(NSInteger statue) { |
| 224 | if (resultBlock) { | 224 | if (resultBlock) { |
| 225 | if (statue == 0) resultBlock(statue == 0?CNLivePayCostTypeResultSucc:CNLivePayCostTypeResultFail); | 225 | if (statue == 0) resultBlock(statue == 0?CNLivePayCostTypeResultSucc:CNLivePayCostTypeResultFail); |
| 226 | } | 226 | } |
CNLivePayCostModule/Classes/Core/CNLivePayCostNetwork.h
| @@ -30,6 +30,7 @@ NS_ASSUME_NONNULL_BEGIN | @@ -30,6 +30,7 @@ NS_ASSUME_NONNULL_BEGIN | ||
| 30 | /// @param balance_fee 余额金额 | 30 | /// @param balance_fee 余额金额 |
| 31 | /// @param notify_url 服务端回调地址 | 31 | /// @param notify_url 服务端回调地址 |
| 32 | /// @param type 支付方式 3:支付宝,4:余额,9:云闪付 | 32 | /// @param type 支付方式 3:支付宝,4:余额,9:云闪付 |
| 33 | +/// @param threeType 支付类型 | ||
| 33 | /// @param frmId 渠道id | 34 | /// @param frmId 渠道id |
| 34 | /// param completerBlock 返回 | 35 | /// param completerBlock 返回 |
| 35 | +(void)requestWithUMSPayForPrePayWithOrderId:(NSString *)orderId | 36 | +(void)requestWithUMSPayForPrePayWithOrderId:(NSString *)orderId |
| @@ -39,6 +40,7 @@ NS_ASSUME_NONNULL_BEGIN | @@ -39,6 +40,7 @@ NS_ASSUME_NONNULL_BEGIN | ||
| 39 | BalanceFee:(NSString *)balance_fee | 40 | BalanceFee:(NSString *)balance_fee |
| 40 | NotifyUrl:(NSString *)notify_url | 41 | NotifyUrl:(NSString *)notify_url |
| 41 | Type:(CNLivePayCostPayType)type | 42 | Type:(CNLivePayCostPayType)type |
| 43 | + ThreePayType:(CNLivePayCostThreePayType)threeType | ||
| 42 | FrmId:(NSString *)frmId | 44 | FrmId:(NSString *)frmId |
| 43 | PassWord:(NSString *)password | 45 | PassWord:(NSString *)password |
| 44 | CompleterBlcok:(void(^)(NSInteger statue))completerBlock; | 46 | CompleterBlcok:(void(^)(NSInteger statue))completerBlock; |
| @@ -77,6 +79,7 @@ NS_ASSUME_NONNULL_BEGIN | @@ -77,6 +79,7 @@ NS_ASSUME_NONNULL_BEGIN | ||
| 77 | @param desc 描述 | 79 | @param desc 描述 |
| 78 | @param notifyUrl 回调地址 | 80 | @param notifyUrl 回调地址 |
| 79 | @param password 支付密码 | 81 | @param password 支付密码 |
| 82 | + @param threeType 三方支付 | ||
| 80 | @param completerBlock 支付结果返回 | 83 | @param completerBlock 支付结果返回 |
| 81 | */ | 84 | */ |
| 82 | -(void)requestActiveGroupWjjPayMentWithFromId:(NSString *)fromId | 85 | -(void)requestActiveGroupWjjPayMentWithFromId:(NSString *)fromId |
| @@ -88,6 +91,7 @@ NS_ASSUME_NONNULL_BEGIN | @@ -88,6 +91,7 @@ NS_ASSUME_NONNULL_BEGIN | ||
| 88 | Desc:(NSString *)desc | 91 | Desc:(NSString *)desc |
| 89 | NotifyUrl:(NSString *)notifyUrl | 92 | NotifyUrl:(NSString *)notifyUrl |
| 90 | PassWord:(NSString *)password | 93 | PassWord:(NSString *)password |
| 94 | + ThreePayType:(CNLivePayCostThreePayType)threeType | ||
| 91 | CompleterBlock:(void (^)(NSInteger))completerBlock; | 95 | CompleterBlock:(void (^)(NSInteger))completerBlock; |
| 92 | 96 | ||
| 93 | /// 判断是否有支付密码 | 97 | /// 判断是否有支付密码 |
CNLivePayCostModule/Classes/Core/CNLivePayCostNetwork.m
| @@ -40,6 +40,7 @@ static NSString *const CNLiveWillBecomeActivePaycostForSHShopNotification = @"CN | @@ -40,6 +40,7 @@ static NSString *const CNLiveWillBecomeActivePaycostForSHShopNotification = @"CN | ||
| 40 | /// @param balance_fee 余额金额 | 40 | /// @param balance_fee 余额金额 |
| 41 | /// @param notify_url 服务端回调地址 | 41 | /// @param notify_url 服务端回调地址 |
| 42 | /// @param type 支付方式 3:支付宝,4:余额,9:云闪付 | 42 | /// @param type 支付方式 3:支付宝,4:余额,9:云闪付 |
| 43 | +/// @param threeType 支付类型 | ||
| 43 | /// @param frmId 渠道id | 44 | /// @param frmId 渠道id |
| 44 | /// @param completerBlock 返回 | 45 | /// @param completerBlock 返回 |
| 45 | +(void)requestWithUMSPayForPrePayWithOrderId:(NSString *)orderId | 46 | +(void)requestWithUMSPayForPrePayWithOrderId:(NSString *)orderId |
| @@ -49,6 +50,7 @@ static NSString *const CNLiveWillBecomeActivePaycostForSHShopNotification = @"CN | @@ -49,6 +50,7 @@ static NSString *const CNLiveWillBecomeActivePaycostForSHShopNotification = @"CN | ||
| 49 | BalanceFee:(NSString *)balance_fee | 50 | BalanceFee:(NSString *)balance_fee |
| 50 | NotifyUrl:(NSString *)notify_url | 51 | NotifyUrl:(NSString *)notify_url |
| 51 | Type:(CNLivePayCostPayType)type | 52 | Type:(CNLivePayCostPayType)type |
| 53 | + ThreePayType:(CNLivePayCostThreePayType)threeType | ||
| 52 | FrmId:(NSString *)frmId | 54 | FrmId:(NSString *)frmId |
| 53 | PassWord:(NSString *)password | 55 | PassWord:(NSString *)password |
| 54 | CompleterBlcok:(void(^)(NSInteger statue))completerBlock | 56 | CompleterBlcok:(void(^)(NSInteger statue))completerBlock |
| @@ -65,14 +67,22 @@ static NSString *const CNLiveWillBecomeActivePaycostForSHShopNotification = @"CN | @@ -65,14 +67,22 @@ static NSString *const CNLiveWillBecomeActivePaycostForSHShopNotification = @"CN | ||
| 65 | }]; | 67 | }]; |
| 66 | }else if (type == CNLivePayCostPayTypeWjjPay) { | 68 | }else if (type == CNLivePayCostPayTypeWjjPay) { |
| 67 | 69 | ||
| 70 | + NSString * notifyUrls = threeType == CNLivePayCostThreePayTypeTicke ? CNJSFYNotifyUrl: (type == CNLivePayCostPayTypeWeChatPay ? CNWeChatPayUrl : type == CNLivePayCostPayTypeAliPay ? CNAliPayUrl : CNUnionPayUrl); | ||
| 71 | + | ||
| 72 | + //上海电商需要特殊的回调地址 | ||
| 73 | + if (!CNLiveStringIsEmpty(notify_url) | ||
| 74 | + && threeType == CNLivePayCostThreePayTypeSHSop) notifyUrls = notify_url; | ||
| 75 | + | ||
| 76 | + NSString * desc = threeType == CNLivePayCostThreePayTypeScren?@"扫码支付":body; | ||
| 77 | + | ||
| 68 | NSDictionary * paramDict = @{ | 78 | NSDictionary * paramDict = @{ |
| 69 | @"appId":AppId, | 79 | @"appId":AppId, |
| 70 | @"user_id":CNUserShareModel.uid?CNUserShareModel.uid:@"", | 80 | @"user_id":CNUserShareModel.uid?CNUserShareModel.uid:@"", |
| 71 | @"out_trade_no":orderId, | 81 | @"out_trade_no":orderId, |
| 72 | - @"body":body, | 82 | + @"body":desc, |
| 73 | @"coupon_fee":@"0", | 83 | @"coupon_fee":@"0", |
| 74 | @"balance_fee":price, | 84 | @"balance_fee":price, |
| 75 | - @"notify_url":notify_url, | 85 | + @"notify_url":notifyUrls, |
| 76 | @"page_url":@"", | 86 | @"page_url":@"", |
| 77 | @"type":@"4", | 87 | @"type":@"4", |
| 78 | @"password":[NSString md5String:password], | 88 | @"password":[NSString md5String:password], |
| @@ -90,7 +100,8 @@ static NSString *const CNLiveWillBecomeActivePaycostForSHShopNotification = @"CN | @@ -90,7 +100,8 @@ static NSString *const CNLiveWillBecomeActivePaycostForSHShopNotification = @"CN | ||
| 90 | [QMUITips showError:[errorMessage isNotBlank]?errorMessage:@"支付失败" inView:AppKeyWindow hideAfterDelay:1.5]; | 100 | [QMUITips showError:[errorMessage isNotBlank]?errorMessage:@"支付失败" inView:AppKeyWindow hideAfterDelay:1.5]; |
| 91 | if (completerBlock) { | 101 | if (completerBlock) { |
| 92 | if (errorCode == 100011) completerBlock(2); | 102 | if (errorCode == 100011) completerBlock(2); |
| 93 | - if (errorCode != 100011) completerBlock(3); | 103 | + if (errorCode == 100010) completerBlock(1); |
| 104 | + if (errorCode != 100010 && errorCode != 100011) completerBlock(3); | ||
| 94 | } | 105 | } |
| 95 | } | 106 | } |
| 96 | }]; | 107 | }]; |
| @@ -100,15 +111,24 @@ static NSString *const CNLiveWillBecomeActivePaycostForSHShopNotification = @"CN | @@ -100,15 +111,24 @@ static NSString *const CNLiveWillBecomeActivePaycostForSHShopNotification = @"CN | ||
| 100 | if (type == CNLivePayCostPayTypeAliPay) index = @"3"; | 111 | if (type == CNLivePayCostPayTypeAliPay) index = @"3"; |
| 101 | if (type == CNLivePayCostPayTypeUnionPay) index = @"9"; | 112 | if (type == CNLivePayCostPayTypeUnionPay) index = @"9"; |
| 102 | if (type == CNLivePayCostPayTypeWjjPay) index = @"4"; | 113 | if (type == CNLivePayCostPayTypeWjjPay) index = @"4"; |
| 114 | + | ||
| 115 | + NSString * notifyUrls = threeType == CNLivePayCostThreePayTypeTicke ? CNJSFYNotifyUrl: (type == CNLivePayCostPayTypeWeChatPay ? CNWeChatPayUrl : type == CNLivePayCostPayTypeAliPay ? CNAliPayUrl : CNUnionPayUrl); | ||
| 116 | + | ||
| 117 | + //上海电商需要特殊的回调地址 | ||
| 118 | + if (!CNLiveStringIsEmpty(notify_url) | ||
| 119 | + && threeType == CNLivePayCostThreePayTypeSHSop) notifyUrls = notify_url; | ||
| 120 | + | ||
| 121 | + NSString * desc = threeType == CNLivePayCostThreePayTypeScren?@"扫码支付":body; | ||
| 122 | + | ||
| 103 | NSDictionary * paramDict = @{ | 123 | NSDictionary * paramDict = @{ |
| 104 | @"appId":AppId, | 124 | @"appId":AppId, |
| 105 | @"user_id":CNUserShareModel.uid?CNUserShareModel.uid:@"", | 125 | @"user_id":CNUserShareModel.uid?CNUserShareModel.uid:@"", |
| 106 | @"out_trade_no":orderId, | 126 | @"out_trade_no":orderId, |
| 107 | - @"body":body, | 127 | + @"body":desc, |
| 108 | @"total_fee":price, | 128 | @"total_fee":price, |
| 109 | @"coupon_fee":coupon_fee, | 129 | @"coupon_fee":coupon_fee, |
| 110 | @"balance_fee":balance_fee, | 130 | @"balance_fee":balance_fee, |
| 111 | - @"notify_url":notify_url, | 131 | + @"notify_url":notifyUrls, |
| 112 | @"page_url":@"", | 132 | @"page_url":@"", |
| 113 | @"type":index, | 133 | @"type":index, |
| 114 | @"frmId":frmId | 134 | @"frmId":frmId |
| @@ -177,7 +197,7 @@ static NSString *const CNLiveWillBecomeActivePaycostForSHShopNotification = @"CN | @@ -177,7 +197,7 @@ static NSString *const CNLiveWillBecomeActivePaycostForSHShopNotification = @"CN | ||
| 177 | 197 | ||
| 178 | NSString * p = [NSString stringWithFormat:@"%d",(NSInteger)([price floatValue]*100)]; | 198 | NSString * p = [NSString stringWithFormat:@"%d",(NSInteger)([price floatValue]*100)]; |
| 179 | 199 | ||
| 180 | - [CNLivePayCostNetwork requestWithUMSPayForPrePayWithOrderId:groupId Body:desc Price:p CouponFee:@"0" BalanceFee:@"0" NotifyUrl:notifyUrl Type:payType FrmId:@"ios" PassWord:@"" CompleterBlcok:^(NSInteger statue) { | 200 | + [CNLivePayCostNetwork requestWithUMSPayForPrePayWithOrderId:groupId Body:desc Price:p CouponFee:@"0" BalanceFee:@"0" NotifyUrl:notifyUrl Type:payType ThreePayType:threeType FrmId:@"ios" PassWord:@"" CompleterBlcok:^(NSInteger statue) { |
| 181 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ | 201 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ |
| 182 | if (completerBlock) completerBlock(statue); | 202 | if (completerBlock) completerBlock(statue); |
| 183 | }); | 203 | }); |
| @@ -245,7 +265,7 @@ static NSString *const CNLiveWillBecomeActivePaycostForSHShopNotification = @"CN | @@ -245,7 +265,7 @@ static NSString *const CNLiveWillBecomeActivePaycostForSHShopNotification = @"CN | ||
| 245 | if (payType == CNLivePayCostPayTypeWjjPay) { | 265 | if (payType == CNLivePayCostPayTypeWjjPay) { |
| 246 | 266 | ||
| 247 | NSString * toid = threeType == CNLivePayCostTypeOrder ? fundsId : groupId; | 267 | NSString * toid = threeType == CNLivePayCostTypeOrder ? fundsId : groupId; |
| 248 | - [self requestActiveGroupWjjPayMentWithFromId:CNUserShareModel.uid Toid:toid Price:[price floatValue] Expand:expand SourceId:[responseObject objectForKey:@"payId"] PayId:responseObject[@"payId"] Desc:desc NotifyUrl:notifyUrl PassWord:password CompleterBlock:^(NSInteger statue) { | 268 | + [self requestActiveGroupWjjPayMentWithFromId:CNUserShareModel.uid Toid:toid Price:[price floatValue] Expand:expand SourceId:[responseObject objectForKey:@"payId"] PayId:responseObject[@"payId"] Desc:desc NotifyUrl:notifyUrl PassWord:password ThreePayType:threeType CompleterBlock:^(NSInteger statue) { |
| 249 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ | 269 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ |
| 250 | if (completerBlock) completerBlock(statue); | 270 | if (completerBlock) completerBlock(statue); |
| 251 | }); | 271 | }); |
| @@ -301,6 +321,7 @@ static NSString *const CNLiveWillBecomeActivePaycostForSHShopNotification = @"CN | @@ -301,6 +321,7 @@ static NSString *const CNLiveWillBecomeActivePaycostForSHShopNotification = @"CN | ||
| 301 | Desc:(NSString *)desc | 321 | Desc:(NSString *)desc |
| 302 | NotifyUrl:(NSString *)notifyUrl | 322 | NotifyUrl:(NSString *)notifyUrl |
| 303 | PassWord:(NSString *)password | 323 | PassWord:(NSString *)password |
| 324 | + ThreePayType:(CNLivePayCostThreePayType)threeType | ||
| 304 | CompleterBlock:(void (^)(NSInteger))completerBlock | 325 | CompleterBlock:(void (^)(NSInteger))completerBlock |
| 305 | { | 326 | { |
| 306 | 327 | ||
| @@ -308,7 +329,7 @@ static NSString *const CNLiveWillBecomeActivePaycostForSHShopNotification = @"CN | @@ -308,7 +329,7 @@ static NSString *const CNLiveWillBecomeActivePaycostForSHShopNotification = @"CN | ||
| 308 | 329 | ||
| 309 | NSString * p = [NSString stringWithFormat:@"%d",(NSInteger)(price*100)]; | 330 | NSString * p = [NSString stringWithFormat:@"%d",(NSInteger)(price*100)]; |
| 310 | 331 | ||
| 311 | - [CNLivePayCostNetwork requestWithUMSPayForPrePayWithOrderId:payId Body:desc Price:p CouponFee:@"0" BalanceFee:@"0" NotifyUrl:notifyUrl Type:CNLivePayCostPayTypeWjjPay FrmId:@"ios" PassWord:password CompleterBlcok:^(NSInteger statue) { | 332 | + [CNLivePayCostNetwork requestWithUMSPayForPrePayWithOrderId:payId Body:desc Price:p CouponFee:@"0" BalanceFee:@"0" NotifyUrl:notifyUrl Type:CNLivePayCostPayTypeWjjPay ThreePayType:threeType FrmId:@"ios" PassWord:password CompleterBlcok:^(NSInteger statue) { |
| 312 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ | 333 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ |
| 313 | if (completerBlock) completerBlock(statue); | 334 | if (completerBlock) completerBlock(statue); |
| 314 | }); | 335 | }); |
CNLivePayCostModule/Classes/View/CNLivePayCostContentView.m
| @@ -288,27 +288,27 @@ static NSString *const CNActiveContentPayViewIdentifier = @"CNActiveContentPayVi | @@ -288,27 +288,27 @@ static NSString *const CNActiveContentPayViewIdentifier = @"CNActiveContentPayVi | ||
| 288 | } | 288 | } |
| 289 | if (self.payModel.payType == CNLivePayCostTypeOrder) { | 289 | if (self.payModel.payType == CNLivePayCostTypeOrder) { |
| 290 | 290 | ||
| 291 | - [[CNLivePayCostNetwork sharePayCostNetWork] requestActiveGroupWjjPayMentWithFromId:CNUserShareModel.uid Toid:self.payModel.userId Price:self.payModel.price Expand:self.payModel.expand SourceId:self.payModel.orderId PayId:self.payModel.orderId Desc:self.payModel.descStr NotifyUrl:self.payModel.notifyUrl PassWord:password CompleterBlock:^(NSInteger statue) { | 291 | + [[CNLivePayCostNetwork sharePayCostNetWork] requestActiveGroupWjjPayMentWithFromId:CNUserShareModel.uid Toid:self.payModel.userId Price:self.payModel.price Expand:self.payModel.expand SourceId:self.payModel.orderId PayId:self.payModel.orderId Desc:self.payModel.descStr NotifyUrl:self.payModel.notifyUrl PassWord:password ThreePayType:CNLivePayCostThreePayTypeOrder CompleterBlock:^(NSInteger statue) { |
| 292 | [weakSelf showPayStatue:statue]; | 292 | [weakSelf showPayStatue:statue]; |
| 293 | }]; | 293 | }]; |
| 294 | } | 294 | } |
| 295 | if (self.payModel.payType == CNLivePayCostTypeSweep) { | 295 | if (self.payModel.payType == CNLivePayCostTypeSweep) { |
| 296 | - [[CNLivePayCostNetwork sharePayCostNetWork] requestActiveGroupWjjPayMentWithFromId:CNUserShareModel.uid Toid:self.payModel.toId Price:self.payModel.price Expand:self.payModel.expand SourceId:self.payModel.orderId PayId:self.payModel.orderId Desc:self.payModel.descStr NotifyUrl:self.payModel.notifyUrl PassWord:password CompleterBlock:^(NSInteger statue) { | 296 | + [[CNLivePayCostNetwork sharePayCostNetWork] requestActiveGroupWjjPayMentWithFromId:CNUserShareModel.uid Toid:self.payModel.toId Price:self.payModel.price Expand:self.payModel.expand SourceId:self.payModel.orderId PayId:self.payModel.orderId Desc:self.payModel.descStr NotifyUrl:self.payModel.notifyUrl PassWord:password ThreePayType:CNLivePayCostThreePayTypeScren CompleterBlock:^(NSInteger statue) { |
| 297 | [weakSelf showPayStatue:statue]; | 297 | [weakSelf showPayStatue:statue]; |
| 298 | }]; | 298 | }]; |
| 299 | } | 299 | } |
| 300 | if (self.payModel.payType == CNLivePayCostTypeTicke) { | 300 | if (self.payModel.payType == CNLivePayCostTypeTicke) { |
| 301 | - [[CNLivePayCostNetwork sharePayCostNetWork] requestActiveGroupWjjPayMentWithFromId:CNUserShareModel.uid Toid:self.payModel.toId Price:self.payModel.price Expand:self.payModel.expand SourceId:self.payModel.orderId PayId:self.payModel.orderId Desc:self.payModel.descStr NotifyUrl:self.payModel.notifyUrl PassWord:password CompleterBlock:^(NSInteger statue) { | 301 | + [[CNLivePayCostNetwork sharePayCostNetWork] requestActiveGroupWjjPayMentWithFromId:CNUserShareModel.uid Toid:self.payModel.toId Price:self.payModel.price Expand:self.payModel.expand SourceId:self.payModel.orderId PayId:self.payModel.orderId Desc:self.payModel.descStr NotifyUrl:self.payModel.notifyUrl PassWord:password ThreePayType:CNLivePayCostThreePayTypeTicke CompleterBlock:^(NSInteger statue) { |
| 302 | [weakSelf showPayStatue:statue]; | 302 | [weakSelf showPayStatue:statue]; |
| 303 | }]; | 303 | }]; |
| 304 | } | 304 | } |
| 305 | if (self.payModel.payType == CNLivePayCostTypeSHShop) { | 305 | if (self.payModel.payType == CNLivePayCostTypeSHShop) { |
| 306 | - [[CNLivePayCostNetwork sharePayCostNetWork] requestActiveGroupWjjPayMentWithFromId:CNUserShareModel.uid Toid:self.payModel.toId Price:self.payModel.price Expand:self.payModel.expand SourceId:self.payModel.orderId PayId:self.payModel.orderId Desc:self.payModel.descStr NotifyUrl:self.payModel.notifyUrl PassWord:password CompleterBlock:^(NSInteger statue) { | 306 | + [[CNLivePayCostNetwork sharePayCostNetWork] requestActiveGroupWjjPayMentWithFromId:CNUserShareModel.uid Toid:self.payModel.toId Price:self.payModel.price Expand:self.payModel.expand SourceId:self.payModel.orderId PayId:self.payModel.orderId Desc:self.payModel.descStr NotifyUrl:self.payModel.notifyUrl PassWord:password ThreePayType:CNLivePayCostThreePayTypeSHSop CompleterBlock:^(NSInteger statue) { |
| 307 | [weakSelf showPayStatue:statue]; | 307 | [weakSelf showPayStatue:statue]; |
| 308 | }]; | 308 | }]; |
| 309 | } | 309 | } |
| 310 | if (self.payModel.payType == CNLivePayCostTypeHtml) { | 310 | if (self.payModel.payType == CNLivePayCostTypeHtml) { |
| 311 | - [[CNLivePayCostNetwork sharePayCostNetWork] requestActiveGroupWjjPayMentWithFromId:CNUserShareModel.uid Toid:self.payModel.toId Price:self.payModel.price Expand:self.payModel.expand SourceId:self.payModel.orderId PayId:self.payModel.orderId Desc:self.payModel.descStr NotifyUrl:self.payModel.notifyUrl PassWord:password CompleterBlock:^(NSInteger statue) { | 311 | + [[CNLivePayCostNetwork sharePayCostNetWork] requestActiveGroupWjjPayMentWithFromId:CNUserShareModel.uid Toid:self.payModel.toId Price:self.payModel.price Expand:self.payModel.expand SourceId:self.payModel.orderId PayId:self.payModel.orderId Desc:self.payModel.descStr NotifyUrl:self.payModel.notifyUrl PassWord:password ThreePayType:CNLivePayCostThreePayTypeHTML CompleterBlock:^(NSInteger statue) { |
| 312 | [weakSelf showPayStatue:statue]; | 312 | [weakSelf showPayStatue:statue]; |
| 313 | }]; | 313 | }]; |
| 314 | } | 314 | } |
Example/CNLivePayCostModule/CNLIVEViewController.m
| @@ -34,8 +34,8 @@ | @@ -34,8 +34,8 @@ | ||
| 34 | UIButton * batchBtn = [UIButton buttonWithType:UIButtonTypeSystem]; | 34 | UIButton * batchBtn = [UIButton buttonWithType:UIButtonTypeSystem]; |
| 35 | batchBtn.frame = CGRectMake(0, CGRectGetMaxY(requestBtn.frame)+5, kWidth, 70); | 35 | batchBtn.frame = CGRectMake(0, CGRectGetMaxY(requestBtn.frame)+5, kWidth, 70); |
| 36 | batchBtn.backgroundColor = [UIColor cyanColor]; | 36 | batchBtn.backgroundColor = [UIColor cyanColor]; |
| 37 | - [batchBtn setTitle:@"支付宝支付" forState: UIControlStateNormal]; | ||
| 38 | - [batchBtn setTitle:@"支付宝支付" forState: UIControlStateHighlighted]; | 37 | + [batchBtn setTitle:@"电商支付" forState: UIControlStateNormal]; |
| 38 | + [batchBtn setTitle:@"电商支付" forState: UIControlStateHighlighted]; | ||
| 39 | [batchBtn addTarget:self action:@selector(batchRequestAction) forControlEvents:UIControlEventTouchUpInside]; | 39 | [batchBtn addTarget:self action:@selector(batchRequestAction) forControlEvents:UIControlEventTouchUpInside]; |
| 40 | [self.view addSubview:batchBtn]; | 40 | [self.view addSubview:batchBtn]; |
| 41 | } | 41 | } |
| @@ -48,7 +48,6 @@ | @@ -48,7 +48,6 @@ | ||
| 48 | @"descStr":@"测试", | 48 | @"descStr":@"测试", |
| 49 | @"price":@0.01, | 49 | @"price":@0.01, |
| 50 | @"orderType":@"1", | 50 | @"orderType":@"1", |
| 51 | - @"notifyUrl":@"http://unifypay.cnlive.com/test/notify_url" | ||
| 52 | }; | 51 | }; |
| 53 | [CNLivePayCostModule showDefaultPayViwWithParamDict:paramDict PayCostType:CNLivePayCostTypeOrder FromVC:self ResultBlock:^(CNLivePayCostTypeResult resultType) { | 52 | [CNLivePayCostModule showDefaultPayViwWithParamDict:paramDict PayCostType:CNLivePayCostTypeOrder FromVC:self ResultBlock:^(CNLivePayCostTypeResult resultType) { |
| 54 | UIAlertView *alert = [[UIAlertView alloc] initWithTitle:resultType == CNLivePayCostTypeResultSucc?@"支付成功":@"支付失败" message:nil delegate:self cancelButtonTitle:@"确认" otherButtonTitles:nil, nil]; | 53 | UIAlertView *alert = [[UIAlertView alloc] initWithTitle:resultType == CNLivePayCostTypeResultSucc?@"支付成功":@"支付失败" message:nil delegate:self cancelButtonTitle:@"确认" otherButtonTitles:nil, nil]; |