提交 c40981c1 authored 作者: JarvanMo's avatar JarvanMo

fix no_pay bug.

上级 8e878a79
...@@ -2,13 +2,13 @@ PODS: ...@@ -2,13 +2,13 @@ PODS:
- Flutter (1.0.0) - Flutter (1.0.0)
- fluwx (0.0.1): - fluwx (0.0.1):
- Flutter - Flutter
- fluwx/pay (= 0.0.1) - fluwx/no_pay (= 0.0.1)
- fluwx/pay (0.0.1): - fluwx/no_pay (0.0.1):
- Flutter - Flutter
- WechatOpenSDK-XCFramework (~> 2.0.2) - "OpenWeChatSDKNoPay (~> 2.0.2+1)"
- integration_test (0.0.1): - integration_test (0.0.1):
- Flutter - Flutter
- WechatOpenSDK-XCFramework (2.0.2) - OpenWeChatSDKNoPay (2.0.2)
DEPENDENCIES: DEPENDENCIES:
- Flutter (from `Flutter`) - Flutter (from `Flutter`)
...@@ -17,7 +17,7 @@ DEPENDENCIES: ...@@ -17,7 +17,7 @@ DEPENDENCIES:
SPEC REPOS: SPEC REPOS:
trunk: trunk:
- WechatOpenSDK-XCFramework - OpenWeChatSDKNoPay
EXTERNAL SOURCES: EXTERNAL SOURCES:
Flutter: Flutter:
...@@ -29,10 +29,10 @@ EXTERNAL SOURCES: ...@@ -29,10 +29,10 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS: SPEC CHECKSUMS:
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
fluwx: 6e8b0aa360e5fc3591cbe4b304763d9d316673af fluwx: 143bf1458e1a46493eb0bc18deb1ee90037f4c30
integration_test: 13825b8a9334a850581300559b8839134b124670 integration_test: 13825b8a9334a850581300559b8839134b124670
WechatOpenSDK-XCFramework: acdeeda129efbef9532bca8a10c24e1b4b8c7d69 OpenWeChatSDKNoPay: 59a9628a746352bb400329cb7f12e6dc7096bf6e
PODFILE CHECKSUM: beab77b38961de946f08660e554f80ac174dc842 PODFILE CHECKSUM: beab77b38961de946f08660e554f80ac174dc842
COCOAPODS: 1.11.3 COCOAPODS: 1.12.1
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#import "FluwxPlugin.h" #import "FluwxPlugin.h"
#import "WXApiRequestHandler.h" #import "WXApiRequestHandler.h"
#import "WechatAuthSDK.h" #import "WechatAuthSDK.h"
#import <WXApi.h>
@class FluwxStringUtil; @class FluwxStringUtil;
......
...@@ -26,7 +26,7 @@ FlutterMethodChannel *_fluwxMethodChannel = nil; ...@@ -26,7 +26,7 @@ FlutterMethodChannel *_fluwxMethodChannel = nil;
SendAuthReq *authReq = [[SendAuthReq alloc] init]; SendAuthReq *authReq = [[SendAuthReq alloc] init];
authReq.scope = call.arguments[@"scope"]; authReq.scope = call.arguments[@"scope"];
authReq.state = (call.arguments[@"state"] == (id) [NSNull null]) ? nil : call.arguments[@"state"]; authReq.state = (call.arguments[@"state"] == (id) [NSNull null]) ? nil : call.arguments[@"state"];
[WXApi sendAuthReq:authReq viewController:vc delegate:[FluwxResponseHandler defaultManager] completion:^(BOOL success) { [WXApi sendAuthReq:authReq viewController:vc delegate:self completion:^(BOOL success) {
result(@(success)); result(@(success));
}]; }];
} }
......
差异被折叠。
//
// Created by mo on 2020/3/7.
//
#import <Foundation/Foundation.h>
#import <Flutter/Flutter.h>
#import <Flutter/Flutter.h>
#import <WXApi.h>
#import <WXApiObject.h>
@protocol WXApiManagerDelegate <NSObject>
@optional
- (void)managerDidRecvGetMessageReq:(GetMessageFromWXReq *)request;
- (void)managerDidRecvShowMessageReq:(ShowMessageFromWXReq *)request;
- (void)managerDidRecvLaunchFromWXReq:(LaunchFromWXReq *)request;
- (void)managerDidRecvMessageResponse:(SendMessageToWXResp *)response;
- (void)managerDidRecvAuthResponse:(SendAuthResp *)response;
- (void)managerDidRecvAddCardResponse:(AddCardToWXCardPackageResp *)response;
- (void)managerDidRecvChooseCardResponse:(WXChooseCardResp *)response;
- (void)managerDidRecvChooseInvoiceResponse:(WXChooseInvoiceResp *)response;
- (void)managerDidRecvSubscribeMsgResponse:(WXSubscribeMsgResp *)response;
- (void)managerDidRecvLaunchMiniProgram:(WXLaunchMiniProgramResp *)response;
- (void)managerDidRecvInvoiceAuthInsertResponse:(WXInvoiceAuthInsertResp *)response;
- (void)managerDidRecvNonTaxpayResponse:(WXNontaxPayResp *)response;
- (void)managerDidRecvPayInsuranceResponse:(WXPayInsuranceResp *)response;
- (void)managerDidRecvPaymentResponse:(PayResp *)response;
@end
@interface FluwxResponseHandler : NSObject <WXApiDelegate>
@property(nonatomic, assign) id <WXApiManagerDelegate> delegate;
+ (instancetype)defaultManager;
- (void)setMethodChannel:(FlutterMethodChannel *)flutterMethodChannel;
@end
差异被折叠。
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import <WXApiObject.h> #import <WXApiObject.h>
#import "FluwxResponseHandler.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
...@@ -142,6 +141,7 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -142,6 +141,7 @@ NS_ASSUME_NONNULL_BEGIN
completion:(void (^ __nullable)(BOOL success))completion; completion:(void (^ __nullable)(BOOL success))completion;
#ifndef NO_PAY
+ (void)sendPayment:(NSString *)appId + (void)sendPayment:(NSString *)appId
PartnerId:(NSString *)partnerId PartnerId:(NSString *)partnerId
PrepayId:(NSString *)prepayId PrepayId:(NSString *)prepayId
...@@ -150,6 +150,7 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -150,6 +150,7 @@ NS_ASSUME_NONNULL_BEGIN
Package:(NSString *)package Package:(NSString *)package
Sign:(NSString *)sign Sign:(NSString *)sign
completion:(void (^ __nullable)(BOOL success))completion; completion:(void (^ __nullable)(BOOL success))completion;
#endif
+ (void)openCustomerService:(NSString *)url + (void)openCustomerService:(NSString *)url
CorpId:(NSString *)corpId CorpId:(NSString *)corpId
......
...@@ -381,7 +381,7 @@ ...@@ -381,7 +381,7 @@
return [WXApi sendAuthReq:req return [WXApi sendAuthReq:req
viewController:viewController viewController:viewController
delegate:[FluwxResponseHandler defaultManager] delegate:self
completion:completion]; completion:completion];
} }
...@@ -426,7 +426,7 @@ ...@@ -426,7 +426,7 @@
[WXApi sendReq:chooseInvoiceReq completion:completion]; [WXApi sendReq:chooseInvoiceReq completion:completion];
} }
#ifndef NO_PAY
+ (void)sendPayment:(NSString *)appId PartnerId:(NSString *)partnerId PrepayId:(NSString *)prepayId NonceStr:(NSString *)nonceStr Timestamp:(UInt32)timestamp Package:(NSString *)package Sign:(NSString *)sign + (void)sendPayment:(NSString *)appId PartnerId:(NSString *)partnerId PrepayId:(NSString *)prepayId NonceStr:(NSString *)nonceStr Timestamp:(UInt32)timestamp Package:(NSString *)package Sign:(NSString *)sign
completion:(void (^ __nullable)(BOOL success))completion { completion:(void (^ __nullable)(BOOL success))completion {
...@@ -442,6 +442,7 @@ ...@@ -442,6 +442,7 @@
[WXApi sendReq:req completion:completion]; [WXApi sendReq:req completion:completion];
} }
#endif
+ (void)openCustomerService:(NSString *)url CorpId:(NSString *)corpId completion:(void (^)(BOOL))completion { + (void)openCustomerService:(NSString *)url CorpId:(NSString *)corpId completion:(void (^)(BOOL))completion {
WXOpenCustomerServiceReq *req = [[WXOpenCustomerServiceReq alloc] init]; WXOpenCustomerServiceReq *req = [[WXOpenCustomerServiceReq alloc] init];
......
...@@ -17,16 +17,16 @@ project_dir = calling_dir.slice(0..(calling_dir.index('/.symlinks'))) ...@@ -17,16 +17,16 @@ project_dir = calling_dir.slice(0..(calling_dir.index('/.symlinks')))
flutter_project_dir = calling_dir.slice(0..(calling_dir.index('/ios/.symlinks'))) flutter_project_dir = calling_dir.slice(0..(calling_dir.index('/ios/.symlinks')))
cfg = YAML.load_file(File.join(flutter_project_dir, 'pubspec.yaml')) cfg = YAML.load_file(File.join(flutter_project_dir, 'pubspec.yaml'))
debug_logging = '0' debug_logging = '0'
if cfg['fluwx'] && cfg['fluwx']['debug_logging'] == 'true' if cfg['fluwx'] && cfg['fluwx']['debug_logging'] == true
debug_logging = '1' debug_logging = '1'
end end
if cfg['fluwx'] && cfg['fluwx']['ios'] && cfg['fluwx']['ios']['no_pay'] == 'enabled' if cfg['fluwx'] && cfg['fluwx']['ios'] && cfg['fluwx']['ios']['no_pay'] == true
fluwx_subspec = 'no_pay' fluwx_subspec = 'no_pay'
else else
fluwx_subspec = 'pay' fluwx_subspec = 'pay'
end end
Pod::UI.puts "wechatsdk #{fluwx_subspec}" Pod::UI.puts "using sdk with #{fluwx_subspec}"
if cfg['fluwx'] && (cfg['fluwx']['app_id'] && cfg['fluwx']['ios'] && cfg['fluwx']['ios']['universal_link']) if cfg['fluwx'] && (cfg['fluwx']['app_id'] && cfg['fluwx']['ios'] && cfg['fluwx']['ios']['universal_link'])
app_id = cfg['fluwx']['app_id'] app_id = cfg['fluwx']['app_id']
universal_link = cfg['fluwx']['ios']['universal_link'] universal_link = cfg['fluwx']['ios']['universal_link']
...@@ -57,16 +57,18 @@ The capability of implementing WeChat SDKs in Flutter. With Fluwx, developers ca ...@@ -57,16 +57,18 @@ The capability of implementing WeChat SDKs in Flutter. With Fluwx, developers ca
sp.dependency 'WechatOpenSDK-XCFramework','~> 2.0.2' sp.dependency 'WechatOpenSDK-XCFramework','~> 2.0.2'
sp.pod_target_xcconfig = { sp.pod_target_xcconfig = {
'OTHER_LDFLAGS' => '$(inherited) -ObjC -all_load', 'OTHER_LDFLAGS' => '$(inherited) -ObjC -all_load',
"GCC_PREPROCESSOR_DEFINITIONS_Debug" => "WECHAT_LOGGING=#{debug_logging}" "GCC_PREPROCESSOR_DEFINITIONS_Debug" => "$(inherited) WECHAT_LOGGING=#{debug_logging}"
} }
end end
s.subspec 'no_pay' do |sp| s.subspec 'no_pay' do |sp|
sp.dependency 'OpenWeChatSDKNoPay','~> 2.0.2' sp.dependency 'OpenWeChatSDKNoPay','~> 2.0.2+1'
sp.frameworks = 'CoreGraphics', 'Security', 'WebKit'
sp.libraries = 'c++', 'z', 'sqlite3.0'
sp.pod_target_xcconfig = { sp.pod_target_xcconfig = {
'OTHER_LDFLAGS' => '$(inherited) -ObjC -all_load', 'OTHER_LDFLAGS' => '$(inherited) -ObjC -all_load',
'GCC_PREPROCESSOR_DEFINITIONS' => 'NO_PAY=1', 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) NO_PAY=1',
"GCC_PREPROCESSOR_DEFINITIONS_Debug" => "WECHAT_LOGGING=#{debug_logging}" "GCC_PREPROCESSOR_DEFINITIONS_Debug" => "$(inherited) WECHAT_LOGGING=#{debug_logging}"
} }
end end
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论