diff --git a/ios/RCTWeChat.m b/ios/RCTWeChat.m index 88a15c2..f8a26b4 100644 --- a/ios/RCTWeChat.m +++ b/ios/RCTWeChat.m @@ -498,26 +498,26 @@ RCT_EXPORT_METHOD(launchMiniProgram:(NSDictionary *)data // callback(@[success ? [NSNull null] : INVOKE_FAILED]); } -RCT_EXPORT_METHOD(pay:(NSDictionary *)data - :(RCTResponseSenderBlock)callback) -{ - PayReq* req = [PayReq new]; - req.partnerId = data[@"partnerId"]; - req.prepayId = data[@"prepayId"]; - req.nonceStr = data[@"nonceStr"]; - req.timeStamp = [data[@"timeStamp"] unsignedIntValue]; - req.package = data[@"package"]; - req.sign = data[@"sign"]; - void ( ^ completion )( BOOL ); - completion = ^( BOOL success ) - { - callback(@[success ? [NSNull null] : INVOKE_FAILED]); - return; - }; - [WXApi sendReq:req completion:completion]; - // BOOL success = [WXApi sendReq:req]; - // callback(@[success ? [NSNull null] : INVOKE_FAILED]); -} +//RCT_EXPORT_METHOD(pay:(NSDictionary *)data +// :(RCTResponseSenderBlock)callback) +//{ +// PayReq* req = [PayReq new]; +// req.partnerId = data[@"partnerId"]; +// req.prepayId = data[@"prepayId"]; +// req.nonceStr = data[@"nonceStr"]; +// req.timeStamp = [data[@"timeStamp"] unsignedIntValue]; +// req.package = data[@"package"]; +// req.sign = data[@"sign"]; +// void ( ^ completion )( BOOL ); +// completion = ^( BOOL success ) +// { +// callback(@[success ? [NSNull null] : INVOKE_FAILED]); +// return; +// }; +// [WXApi sendReq:req completion:completion]; +// // BOOL success = [WXApi sendReq:req]; +// // callback(@[success ? [NSNull null] : INVOKE_FAILED]); +//} #pragma mark - wx callback @@ -566,14 +566,14 @@ RCT_EXPORT_METHOD(pay:(NSDictionary *)data else { [self.bridge.eventDispatcher sendDeviceEventWithName:RCTWXEventName body:body]; } - } else if ([resp isKindOfClass:[PayResp class]]) { - PayResp *r = (PayResp *)resp; - NSMutableDictionary *body = @{@"errCode":@(r.errCode)}.mutableCopy; - body[@"errStr"] = r.errStr; - body[@"type"] = @(r.type); - body[@"returnKey"] =r.returnKey; - body[@"type"] = @"PayReq.Resp"; - [self.bridge.eventDispatcher sendDeviceEventWithName:RCTWXEventName body:body]; +// } else if ([resp isKindOfClass:[PayResp class]]) { +// PayResp *r = (PayResp *)resp; +// NSMutableDictionary *body = @{@"errCode":@(r.errCode)}.mutableCopy; +// body[@"errStr"] = r.errStr; +// body[@"type"] = @(r.type); +// body[@"returnKey"] =r.returnKey; +// body[@"type"] = @"PayReq.Resp"; +// [self.bridge.eventDispatcher sendDeviceEventWithName:RCTWXEventName body:body]; } else if ([resp isKindOfClass:[WXLaunchMiniProgramResp class]]){ WXLaunchMiniProgramResp *r = (WXLaunchMiniProgramResp *)resp; NSMutableDictionary *body = @{@"errCode":@(r.errCode)}.mutableCopy; diff --git a/package.json b/package.json index d19abc6..0a5085c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-wechat-lib", - "version": "1.1.18", + "version": "1.1.19-notpay", "description": "react-native library for wechat app. 支持分享和拉起小程序。", "main": "index.js", "scripts": { diff --git a/react-native-wechat-lib b/react-native-wechat-lib new file mode 120000 index 0000000..74c635c --- /dev/null +++ b/react-native-wechat-lib @@ -0,0 +1 @@ +react-native-wechat-lib \ No newline at end of file