From e04c0be6c0de3fed42351f8a8ccc48a16579e16d Mon Sep 17 00:00:00 2001 From: Jonas Bark Date: Sat, 28 Sep 2024 11:41:16 +0200 Subject: [PATCH 1/5] Fix border radius handling, see https://github.com/flutter-stripe/flutter_stripe/pull/1933 --- .../src/main/kotlin/com/facebook/react/bridge/ReadableMap.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/stripe_android/android/src/main/kotlin/com/facebook/react/bridge/ReadableMap.java b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/bridge/ReadableMap.java index 78908982..92bf046e 100644 --- a/packages/stripe_android/android/src/main/kotlin/com/facebook/react/bridge/ReadableMap.java +++ b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/bridge/ReadableMap.java @@ -44,7 +44,7 @@ public boolean hasKey(String key) { public Integer getInt(String key) throws Exception { if (map.opt(key) instanceof Double) { - throw new Exception("We've got a double here"); + return (int) getDouble(key); } return map.getInt(key); } From 31b72b17cc91f0f681fc3a19f62c82c14c6e7a76 Mon Sep 17 00:00:00 2001 From: Jonas Bark Date: Sat, 28 Sep 2024 11:41:44 +0200 Subject: [PATCH 2/5] throw warning when incompatible com.android.application plugin is used see https://github.com/flutter-stripe/flutter_stripe/issues/1909 --- packages/stripe_android/android/build.gradle | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/stripe_android/android/build.gradle b/packages/stripe_android/android/build.gradle index cb87ff3a..5acf7caa 100644 --- a/packages/stripe_android/android/build.gradle +++ b/packages/stripe_android/android/build.gradle @@ -65,3 +65,12 @@ dependencies { // Users need to declare this dependency on their own, otherwise all methods are a no-op compileOnly 'com.stripe:stripe-android-issuing-push-provisioning:1.1.0' } + +afterEvaluate { + // check version of com.android.application - fail if 8.0.0 or higher + def androidPluginVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION + print("android plugin version: " + androidPluginVersion) + if (androidPluginVersion >= '8.0.0') { + throw new GradleException("flutter_stripe: Stripe Android SDK requires com.android.application plugin lower than 8.0.0.\nSee https://github.com/flutter-stripe/flutter_stripe/issues/1909\n") + } +} From 22b62ae2ebe584d4871b6658ac6aa2e5095334d0 Mon Sep 17 00:00:00 2001 From: Jonas Bark Date: Sat, 28 Sep 2024 11:41:44 +0200 Subject: [PATCH 3/5] throw warning when incompatible com.android.application plugin is used see https://github.com/flutter-stripe/flutter_stripe/issues/1909 --- packages/stripe_android/android/build.gradle | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/stripe_android/android/build.gradle b/packages/stripe_android/android/build.gradle index cb87ff3a..0ce4460f 100644 --- a/packages/stripe_android/android/build.gradle +++ b/packages/stripe_android/android/build.gradle @@ -65,3 +65,11 @@ dependencies { // Users need to declare this dependency on their own, otherwise all methods are a no-op compileOnly 'com.stripe:stripe-android-issuing-push-provisioning:1.1.0' } + +afterEvaluate { + // check version of com.android.application - fail if 8.0.0 or higher + def androidPluginVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION + if (androidPluginVersion >= '8.0.0') { + throw new GradleException("flutter_stripe: Stripe Android SDK requires com.android.application plugin lower than 8.0.0.\nSee https://github.com/flutter-stripe/flutter_stripe/issues/1909\n") + } +} From bc527ebab7d5cbbe29bd2b37555a1d418382a46c Mon Sep 17 00:00:00 2001 From: Jonas Bark Date: Sat, 28 Sep 2024 11:49:22 +0200 Subject: [PATCH 4/5] remove unnecessary println --- packages/stripe_android/android/build.gradle | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/stripe_android/android/build.gradle b/packages/stripe_android/android/build.gradle index 5acf7caa..0ce4460f 100644 --- a/packages/stripe_android/android/build.gradle +++ b/packages/stripe_android/android/build.gradle @@ -69,7 +69,6 @@ dependencies { afterEvaluate { // check version of com.android.application - fail if 8.0.0 or higher def androidPluginVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION - print("android plugin version: " + androidPluginVersion) if (androidPluginVersion >= '8.0.0') { throw new GradleException("flutter_stripe: Stripe Android SDK requires com.android.application plugin lower than 8.0.0.\nSee https://github.com/flutter-stripe/flutter_stripe/issues/1909\n") } From 427b4f1831c2f78a5f0498062fd8ae87935218ac Mon Sep 17 00:00:00 2001 From: Jonas Bark Date: Sat, 28 Sep 2024 12:04:39 +0200 Subject: [PATCH 5/5] Fix iOS issue from https://github.com/flutter-stripe/flutter_stripe/issues/1928 --- packages/stripe_ios/ios/Classes/CardFieldFactory.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/stripe_ios/ios/Classes/CardFieldFactory.swift b/packages/stripe_ios/ios/Classes/CardFieldFactory.swift index e85f0c68..082a5582 100644 --- a/packages/stripe_ios/ios/Classes/CardFieldFactory.swift +++ b/packages/stripe_ios/ios/Classes/CardFieldFactory.swift @@ -162,7 +162,7 @@ extension CardFieldView { cardParams.type = STPPaymentMethodType.card cardParams.card = cardMethodParams - self.cardField.paymentMethodParams.card = cardMethodParams + self.cardField.paymentMethodParams = STPPaymentMethodParams.paramsWith(card: cardMethodParams, billingDetails: nil, metadata: nil) self.cardField.postalCode = params["postalCode"] as? String self.cardParams = cardParams self.cardPostalCode = params["postalCode"] as? String