Skip to content

Commit

Permalink
Fix #2072 throw an exception instead of a crash for unknown type plat…
Browse files Browse the repository at this point in the history
…form pay supported
  • Loading branch information
Remon committed Feb 17, 2025
1 parent 7511d55 commit 31cee71
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion example/android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pluginManagement {
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "8.7.3" apply false
id "org.jetbrains.kotlin.android" version "1.8.10" apply false
id "org.jetbrains.kotlin.android" version "1.8.22" apply false
}

include ":app"
Original file line number Diff line number Diff line change
Expand Up @@ -424,10 +424,16 @@ class MethodChannelStripe extends StripePlatform {
}) async {
bool? isSupported;
if (params == null) {
isSupported =
await _methodChannel.invokeMethod('isPlatformPaySupported', {
final result =
await _methodChannel.invokeMethod<dynamic>('isPlatformPaySupported', {
'params': {},
});

if (result is bool) {
isSupported = result;
} else {
StripeException.fromJson(result);
}
} else {
isSupported = await _methodChannel
.invokeMethod('isPlatformPaySupported', {'params': params.toJson()});
Expand Down

0 comments on commit 31cee71

Please sign in to comment.