Skip to content

Commit d159303

Browse files
author
Jarvan Zhang
committed
add showPayLoading for android & oh
1 parent d0615e3 commit d159303

File tree

12 files changed

+78
-21
lines changed

12 files changed

+78
-21
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 5.2.0
2+
* Android Sdk升级到15.8.35
3+
* iOS Sdk升级到15.8.35
4+
* OpenHarmony Sdk升级到15.8.37
5+
6+
17
## 5.1.2
28
* Android Sdk升级到15.8.33
39
* iOS Sdk升级到15.8.32.5

android/src/main/kotlin/com/jarvan/tobias/TobaisPluginDelegate.kt

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ import com.alipay.sdk.app.EnvUtils
99
import com.alipay.sdk.app.PayTask
1010
import io.flutter.plugin.common.MethodCall
1111
import io.flutter.plugin.common.MethodChannel.Result
12-
import kotlinx.coroutines.*
12+
import kotlinx.coroutines.CoroutineScope
13+
import kotlinx.coroutines.Dispatchers
14+
import kotlinx.coroutines.Job
15+
import kotlinx.coroutines.launch
16+
import kotlinx.coroutines.withContext
1317
import kotlin.coroutines.CoroutineContext
1418

1519
/***
@@ -41,17 +45,20 @@ class TobaisPluginDelegate : CoroutineScope {
4145
} else {
4246
EnvUtils.setEnv(EnvUtils.EnvEnum.ONLINE)
4347
}
44-
val payResult = doPayTask(call.argument("order") ?: "")
48+
val payResult = doPayTask(
49+
call.argument("order") ?: "",
50+
call.argument<Boolean?>("showPayLoading") ?: true
51+
)
4552
withContext(Dispatchers.Main) {
4653
result.success(payResult)
4754
}
4855
}
4956
}
5057

51-
private suspend fun doPayTask(orderInfo: String): Map<String, String> =
58+
private suspend fun doPayTask(orderInfo: String, showPayLoading: Boolean): Map<String, String> =
5259
withContext(Dispatchers.IO) {
5360
val alipay = PayTask(activity)
54-
alipay.payV2(orderInfo, true) ?: mapOf<String, String>()
61+
alipay.payV2(orderInfo, showPayLoading) ?: mapOf<String, String>()
5562
}
5663

5764

example/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
*.swp
66
.DS_Store
77
.atom/
8+
.build/
89
.buildlog/
910
.history
1011
.svn/
12+
.swiftpm/
1113
migrate_working_dir/
1214

1315
# IntelliJ related
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
#!/bin/sh
22
# This is a generated file; do not edit or check into version control.
3-
export "FLUTTER_ROOT=/Users/mo/Development/flutter"
4-
export "FLUTTER_APPLICATION_PATH=/Users/mo/Code/Flutter/tobias/example"
3+
export "FLUTTER_ROOT=/Users/jarvanzhang/Development/flutter"
4+
export "FLUTTER_APPLICATION_PATH=/Users/jarvanzhang/StudioProjects/tobias/example"
55
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
6-
export "FLUTTER_TARGET=/Users/mo/Code/Flutter/tobias/example/lib/main.dart"
6+
export "FLUTTER_TARGET=/Users/jarvanzhang/StudioProjects/tobias/example/lib/main.dart"
77
export "FLUTTER_BUILD_DIR=build"
88
export "FLUTTER_BUILD_NAME=1.0.0"
99
export "FLUTTER_BUILD_NUMBER=1"
10-
export "DART_DEFINES=Zmx1dHRlci5pbnNwZWN0b3Iuc3RydWN0dXJlZEVycm9ycz10cnVl,RkxVVFRFUl9XRUJfQVVUT19ERVRFQ1Q9dHJ1ZQ==,RkxVVFRFUl9XRUJfQ0FOVkFTS0lUX1VSTD1odHRwczovL3d3dy5nc3RhdGljLmNvbS9mbHV0dGVyLWNhbnZhc2tpdC8wNDgxN2M5OWM5ZmQ0OTU2ZjI3NTA1MjA0ZjdlMzQ0MzM1ODEwYWVkLw=="
10+
export "DART_DEFINES=Zmx1dHRlci5pbnNwZWN0b3Iuc3RydWN0dXJlZEVycm9ycz10cnVl,RkxVVFRFUl9WRVJTSU9OPTMuMzIuOA==,RkxVVFRFUl9DSEFOTkVMPXN0YWJsZQ==,RkxVVFRFUl9HSVRfVVJMPWh0dHBzOi8vZ2l0aHViLmNvbS9mbHV0dGVyL2ZsdXR0ZXIuZ2l0,RkxVVFRFUl9GUkFNRVdPUktfUkVWSVNJT049ZWRhZGE3YzU2ZQ==,RkxVVFRFUl9FTkdJTkVfUkVWSVNJT049ZWYwY2QwMDA5MQ==,RkxVVFRFUl9EQVJUX1ZFUlNJT049My44LjE="
1111
export "DART_OBFUSCATION=false"
1212
export "TRACK_WIDGET_CREATION=true"
1313
export "TREE_SHAKE_ICONS=false"
14-
export "PACKAGE_CONFIG=/Users/mo/Code/Flutter/tobias/example/.dart_tool/package_config.json"
14+
export "PACKAGE_CONFIG=/Users/jarvanzhang/StudioProjects/tobias/example/.dart_tool/package_config.json"

example/ios/Podfile.lock

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
PODS:
22
- Flutter (1.0.0)
3-
- integration_test (0.0.1):
4-
- Flutter
53
- tobias (0.0.1):
64
- Flutter
75
- tobias/normal (= 0.0.1)
@@ -10,22 +8,18 @@ PODS:
108

119
DEPENDENCIES:
1210
- Flutter (from `Flutter`)
13-
- integration_test (from `.symlinks/plugins/integration_test/ios`)
1411
- tobias (from `.symlinks/plugins/tobias/ios`)
1512

1613
EXTERNAL SOURCES:
1714
Flutter:
1815
:path: Flutter
19-
integration_test:
20-
:path: ".symlinks/plugins/integration_test/ios"
2116
tobias:
2217
:path: ".symlinks/plugins/tobias/ios"
2318

2419
SPEC CHECKSUMS:
2520
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
26-
integration_test: 13825b8a9334a850581300559b8839134b124670
27-
tobias: cc3bf3abfe6138bbcac1d013b86b8bd872bbf613
21+
tobias: f9c405df3ded93ad34539200fe3e7779cfb19081
2822

2923
PODFILE CHECKSUM: beab77b38961de946f08660e554f80ac174dc842
3024

31-
COCOAPODS: 1.15.2
25+
COCOAPODS: 1.16.2

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
1818
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
1919
F11567A2FA0F5E1CC5E33B84 /* libPods-RunnerTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D2A7BBBBFF709BA27749C289 /* libPods-RunnerTests.a */; };
20+
78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; };
2021
/* End PBXBuildFile section */
2122

2223
/* Begin PBXContainerItemProxy section */
@@ -83,6 +84,7 @@
8384
isa = PBXFrameworksBuildPhase;
8485
buildActionMask = 2147483647;
8586
files = (
87+
78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */,
8688
3762714A2707B51AA41391F0 /* libPods-Runner.a in Frameworks */,
8789
);
8890
runOnlyForDeploymentPostprocessing = 0;
@@ -200,6 +202,9 @@
200202
productType = "com.apple.product-type.bundle.unit-test";
201203
};
202204
97C146ED1CF9000F007C117D /* Runner */ = {
205+
packageProductDependencies = (
206+
78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */,
207+
);
203208
isa = PBXNativeTarget;
204209
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
205210
buildPhases = (
@@ -225,6 +230,9 @@
225230

226231
/* Begin PBXProject section */
227232
97C146E61CF9000F007C117D /* Project object */ = {
233+
packageReferences = (
234+
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */,
235+
);
228236
isa = PBXProject;
229237
attributes = {
230238
LastUpgradeCheck = 1510;
@@ -714,6 +722,18 @@
714722
defaultConfigurationName = Release;
715723
};
716724
/* End XCConfigurationList section */
725+
/* Begin XCLocalSwiftPackageReference section */
726+
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */ = {
727+
isa = XCLocalSwiftPackageReference;
728+
relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage;
729+
};
730+
/* End XCLocalSwiftPackageReference section */
731+
/* Begin XCSwiftPackageProductDependency section */
732+
78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = {
733+
isa = XCSwiftPackageProductDependency;
734+
productName = FlutterGeneratedPluginSwiftPackage;
735+
};
736+
/* End XCSwiftPackageProductDependency section */
717737
};
718738
rootObject = 97C146E61CF9000F007C117D /* Project object */;
719739
}

example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,24 @@
55
<BuildAction
66
parallelizeBuildables = "YES"
77
buildImplicitDependencies = "YES">
8+
<PreActions>
9+
<ExecutionAction
10+
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
11+
<ActionContent
12+
title = "Run Prepare Flutter Framework Script"
13+
scriptText = "/bin/sh &quot;$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh&quot; prepare&#10;">
14+
<EnvironmentBuildable>
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
18+
BuildableName = "Runner.app"
19+
BlueprintName = "Runner"
20+
ReferencedContainer = "container:Runner.xcodeproj">
21+
</BuildableReference>
22+
</EnvironmentBuildable>
23+
</ActionContent>
24+
</ExecutionAction>
25+
</PreActions>
826
<BuildActionEntries>
927
<BuildActionEntry
1028
buildForTesting = "YES"
@@ -26,6 +44,7 @@
2644
buildConfiguration = "Debug"
2745
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2846
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
47+
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
2948
shouldUseLaunchSchemeArgsEnv = "YES">
3049
<MacroExpansion>
3150
<BuildableReference
@@ -54,11 +73,13 @@
5473
buildConfiguration = "Debug"
5574
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
5675
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
76+
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
5777
launchStyle = "0"
5878
useCustomWorkingDirectory = "NO"
5979
ignoresPersistentStateOnLaunch = "NO"
6080
debugDocumentVersioning = "YES"
6181
debugServiceExtension = "internal"
82+
enableGPUValidationMode = "1"
6283
allowLocationSimulation = "YES">
6384
<BuildableProductRunnable
6485
runnableDebuggingMode = "0">

lib/src/tobias.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ class Tobias {
66
/// [universalLink] only supports iOS
77
Future<Map> pay(String order,
88
{AliPayEvn evn = AliPayEvn.online,
9+
bool showPayLoading = true,
910
String? universalLink}) async {
1011
return await TobiasPlatform.instance
1112
.pay(order, evn: evn, universalLink: universalLink);

lib/src/tobias_method_channel.dart

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,14 @@ class MethodChannelTobias extends TobiasPlatform {
1515
@override
1616
Future<Map> pay(String order,
1717
{AliPayEvn evn = AliPayEvn.online,
18+
bool showPayLoading = true,
1819
String? universalLink}) async {
19-
return await methodChannel.invokeMethod("pay",
20-
{"order": order, "payEnv": evn.index, "universalLink": universalLink});
20+
return await methodChannel.invokeMethod("pay", {
21+
"order": order,
22+
"showPayLoading": showPayLoading,
23+
"payEnv": evn.index,
24+
"universalLink": universalLink
25+
});
2126
}
2227

2328
/// 鸿蒙 - 自动订阅支付

lib/src/tobias_platform_interface.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ abstract class TobiasPlatform extends PlatformInterface {
3131
/// [evn] only supports Android due to native AliPaySDK
3232
Future<Map> pay(String order,
3333
{AliPayEvn evn = AliPayEvn.online,
34+
bool showPayLoading = true,
3435
String? universalLink}) async {
3536
throw UnimplementedError('pay() has not been implemented.');
3637
}

0 commit comments

Comments
 (0)