Skip to content

Commit 1ad8a29

Browse files
committed
fix: fix issue that parses created date incorrectly coming from android
1 parent df7dda8 commit 1ad8a29

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

example/android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ if (flutterVersionName == null) {
2626

2727
android {
2828
namespace 'com.flutter.stripe.example'
29-
compileSdk 35
29+
compileSdk 36
3030

3131
compileOptions {
3232
sourceCompatibility JavaVersion.VERSION_17

packages/stripe_platform_interface/lib/src/method_channel_stripe.dart

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -586,14 +586,20 @@ class MethodChannelStripe extends StripePlatform {
586586
@override
587587
Future<FinancialConnectionTokenResult> collectBankAccountToken({
588588
required String clientSecret,
589-
CollectBankAccountTokenParams? params,
589+
required CollectBankAccountTokenParams params,
590590
}) async {
591591
final result = await _methodChannel.invokeMapMethod<String, dynamic>(
592592
'collectBankAccountToken',
593-
{'clientSecret': clientSecret, 'params': params?.toJson()},
593+
{'clientSecret': clientSecret, 'params': params.toJson()},
594594
);
595595

596-
_financialConnectionsEventHandler = params?.onEvent;
596+
// workaround for fact that created is parsed as string from Stripe android
597+
final created = result?['token']['created'];
598+
if (created != null && created is String) {
599+
result?['token']['created'] = int.tryParse(created);
600+
}
601+
602+
_financialConnectionsEventHandler = params.onEvent;
597603

598604
if (result!.containsKey('error')) {
599605
throw ResultParser<void>(parseJson: (json) => {}).parseError(result);

packages/stripe_platform_interface/lib/src/models/payment_sheet.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,6 @@ abstract class PaymentSheetPrimaryButtonThemeColors
451451
/// The text color of the primary button when in a success state. Supports both single color strings and light/dark color objects.
452452
@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson)
453453
Color? successTextColor,
454-
455454
}) = _PaymentSheetPrimaryButtonThemeColors;
456455

457456
factory PaymentSheetPrimaryButtonThemeColors.fromJson(

packages/stripe_platform_interface/lib/src/stripe_platform_interface.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ abstract class StripePlatform extends PlatformInterface {
170170
/// Methods related to financial connections
171171
Future<FinancialConnectionTokenResult> collectBankAccountToken({
172172
required String clientSecret,
173-
CollectBankAccountTokenParams? params,
173+
required CollectBankAccountTokenParams params,
174174
});
175175

176176
Future<FinancialConnectionSessionResult> collectFinancialConnectionsAccounts({

0 commit comments

Comments
 (0)