From db7e810baa4e30e7b2a1b2528d1b2a9aba0714ce Mon Sep 17 00:00:00 2001 From: Fernando Luca de Tena Date: Thu, 9 May 2024 13:10:23 +0200 Subject: [PATCH 1/5] Added fingerprint to the Card model. Solves issues: - https://github.com/flutter-stripe/flutter_stripe/issues/707 - https://github.com/flutter-stripe/flutter_stripe/issues/688 Resolves discussion: - https://github.com/flutter-stripe/flutter_stripe/discussions/691 Sync with issue: https://github.com/stripe/stripe-react-native/pull/914 --- .../lib/src/models/payment_methods.dart | 3 ++ .../src/models/payment_methods.freezed.dart | 30 ++++++++++++++++++- .../lib/src/models/payment_methods.g.dart | 2 ++ 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/packages/stripe_platform_interface/lib/src/models/payment_methods.dart b/packages/stripe_platform_interface/lib/src/models/payment_methods.dart index 65b6d88fa..fa6835907 100644 --- a/packages/stripe_platform_interface/lib/src/models/payment_methods.dart +++ b/packages/stripe_platform_interface/lib/src/models/payment_methods.dart @@ -153,6 +153,9 @@ class Card with _$Card { /// last four digits of the card. String? last4, + /// fingerprint of the card. + String? fingerprint, + /// The preffered card brand for payment String? preferredNetwork, diff --git a/packages/stripe_platform_interface/lib/src/models/payment_methods.freezed.dart b/packages/stripe_platform_interface/lib/src/models/payment_methods.freezed.dart index 5adfb4910..a0f7adf3c 100644 --- a/packages/stripe_platform_interface/lib/src/models/payment_methods.freezed.dart +++ b/packages/stripe_platform_interface/lib/src/models/payment_methods.freezed.dart @@ -1292,6 +1292,9 @@ mixin _$Card { /// last four digits of the card. String? get last4 => throw _privateConstructorUsedError; + /// fingerprint of the card. + String? get fingerprint => throw _privateConstructorUsedError; + /// The preffered card brand for payment String? get preferredNetwork => throw _privateConstructorUsedError; @@ -1319,6 +1322,7 @@ abstract class $CardCopyWith<$Res> { int? expMonth, String? funding, String? last4, + String? fingerprint, String? preferredNetwork, List? availableNetworks, ThreeDSecureUsage? threeDSecureUsage}); @@ -1345,6 +1349,7 @@ class _$CardCopyWithImpl<$Res, $Val extends Card> Object? expMonth = freezed, Object? funding = freezed, Object? last4 = freezed, + Object? fingerprint = freezed, Object? preferredNetwork = freezed, Object? availableNetworks = freezed, Object? threeDSecureUsage = freezed, @@ -1374,6 +1379,10 @@ class _$CardCopyWithImpl<$Res, $Val extends Card> ? _value.last4 : last4 // ignore: cast_nullable_to_non_nullable as String?, + fingerprint: freezed == fingerprint + ? _value.fingerprint + : fingerprint // ignore: cast_nullable_to_non_nullable + as String?, preferredNetwork: freezed == preferredNetwork ? _value.preferredNetwork : preferredNetwork // ignore: cast_nullable_to_non_nullable @@ -1416,6 +1425,7 @@ abstract class _$$CardImplCopyWith<$Res> implements $CardCopyWith<$Res> { int? expMonth, String? funding, String? last4, + String? fingerprint, String? preferredNetwork, List? availableNetworks, ThreeDSecureUsage? threeDSecureUsage}); @@ -1440,6 +1450,7 @@ class __$$CardImplCopyWithImpl<$Res> Object? expMonth = freezed, Object? funding = freezed, Object? last4 = freezed, + Object? fingerprint = freezed, Object? preferredNetwork = freezed, Object? availableNetworks = freezed, Object? threeDSecureUsage = freezed, @@ -1469,6 +1480,10 @@ class __$$CardImplCopyWithImpl<$Res> ? _value.last4 : last4 // ignore: cast_nullable_to_non_nullable as String?, + fingerprint: freezed == fingerprint + ? _value.fingerprint + : fingerprint // ignore: cast_nullable_to_non_nullable + as String?, preferredNetwork: freezed == preferredNetwork ? _value.preferredNetwork : preferredNetwork // ignore: cast_nullable_to_non_nullable @@ -1496,6 +1511,7 @@ class _$CardImpl implements _Card { this.expMonth, this.funding, this.last4, + this.fingerprint, this.preferredNetwork, final List? availableNetworks, this.threeDSecureUsage}) @@ -1528,6 +1544,10 @@ class _$CardImpl implements _Card { @override final String? last4; + /// fingerprint of the card. + @override + final String? fingerprint; + /// The preffered card brand for payment @override final String? preferredNetwork; @@ -1552,7 +1572,7 @@ class _$CardImpl implements _Card { @override String toString() { - return 'Card(brand: $brand, country: $country, expYear: $expYear, expMonth: $expMonth, funding: $funding, last4: $last4, preferredNetwork: $preferredNetwork, availableNetworks: $availableNetworks, threeDSecureUsage: $threeDSecureUsage)'; + return 'Card(brand: $brand, country: $country, expYear: $expYear, expMonth: $expMonth, funding: $funding, last4: $last4, fingerprint: $fingerprint, preferredNetwork: $preferredNetwork, availableNetworks: $availableNetworks, threeDSecureUsage: $threeDSecureUsage)'; } @override @@ -1567,6 +1587,8 @@ class _$CardImpl implements _Card { other.expMonth == expMonth) && (identical(other.funding, funding) || other.funding == funding) && (identical(other.last4, last4) || other.last4 == last4) && + (identical(other.fingerprint, fingerprint) || + other.fingerprint == fingerprint) && (identical(other.preferredNetwork, preferredNetwork) || other.preferredNetwork == preferredNetwork) && const DeepCollectionEquality() @@ -1585,6 +1607,7 @@ class _$CardImpl implements _Card { expMonth, funding, last4, + fingerprint, preferredNetwork, const DeepCollectionEquality().hash(_availableNetworks), threeDSecureUsage); @@ -1611,6 +1634,7 @@ abstract class _Card implements Card { final int? expMonth, final String? funding, final String? last4, + final String? fingerprint, final String? preferredNetwork, final List? availableNetworks, final ThreeDSecureUsage? threeDSecureUsage}) = _$CardImpl; @@ -1643,6 +1667,10 @@ abstract class _Card implements Card { String? get last4; @override + /// fingerprint of the card. + String? get fingerprint; + @override + /// The preffered card brand for payment String? get preferredNetwork; @override diff --git a/packages/stripe_platform_interface/lib/src/models/payment_methods.g.dart b/packages/stripe_platform_interface/lib/src/models/payment_methods.g.dart index 99bbd8e41..9ab26bcd1 100644 --- a/packages/stripe_platform_interface/lib/src/models/payment_methods.g.dart +++ b/packages/stripe_platform_interface/lib/src/models/payment_methods.g.dart @@ -99,6 +99,7 @@ _$CardImpl _$$CardImplFromJson(Map json) => _$CardImpl( expMonth: json['expMonth'] as int?, funding: json['funding'] as String?, last4: json['last4'] as String?, + fingerprint: json['fingerprint'] as String?, preferredNetwork: json['preferredNetwork'] as String?, availableNetworks: (json['availableNetworks'] as List?) ?.map((e) => e as String) @@ -117,6 +118,7 @@ Map _$$CardImplToJson(_$CardImpl instance) => 'expMonth': instance.expMonth, 'funding': instance.funding, 'last4': instance.last4, + 'fingerprint': instance.fingerprint, 'preferredNetwork': instance.preferredNetwork, 'availableNetworks': instance.availableNetworks, 'threeDSecureUsage': instance.threeDSecureUsage?.toJson(), From 744987a02cffd7178dd3816acb93b3178be80571 Mon Sep 17 00:00:00 2001 From: Fernando Luca de Tena Date: Thu, 9 May 2024 13:21:38 +0200 Subject: [PATCH 2/5] chore(release): publish packages - stripe_platform_interface@10.2.0 - flutter_stripe_web@5.1.1 - flutter_stripe@10.1.2 --- CHANGELOG.md | 41 +++++++++++++++++++ packages/stripe/CHANGELOG.md | 4 ++ packages/stripe/pubspec.yaml | 4 +- .../stripe_platform_interface/CHANGELOG.md | 15 +++++++ .../stripe_platform_interface/pubspec.yaml | 2 +- packages/stripe_web/CHANGELOG.md | 4 ++ packages/stripe_web/pubspec.yaml | 4 +- 7 files changed, 69 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 72fa9968f..7df87579c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,47 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2024-05-09 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`stripe_platform_interface` - `v10.2.0`](#stripe_platform_interface---v1020) + - [`flutter_stripe_web` - `v5.1.1`](#flutter_stripe_web---v511) + - [`flutter_stripe` - `v10.1.2`](#flutter_stripe---v1012) + +Packages with dependency updates only: + +> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project. + + - `flutter_stripe_web` - `v5.1.1` + - `flutter_stripe` - `v10.1.2` + +--- + +#### `stripe_platform_interface` - `v10.2.0` + + - **FIX**: add bankidentifiercode to ideal paymentdata (#1522). + - **FIX**: #1459 allow image to be null (#1466). + - **FIX**: #1409 send usesDeprecatedTokenFlow to stripe platform (#1410). + - **FIX**: #1246 handle empty params on confirmPayment (#1286). + - **FIX**: #1250 incorrectly providing amount to confirmplatformpaysetupintent params (#1255). + - **FIX**: apple pay (#1202). + - **FIX**: timeout payment sheet (#1161). + - **FIX**: implemented handleURLCallback method for iOS iDeal payment. (#939). + - **FEAT**: add retrieveSetupIntent (#1302). + - **FEAT**: release versions (#1283). + - **FEAT**: release 9.2.1 (#1262). + - **FEAT**: stripe js (#1052). + + ## 2024-03-26 ### Changes diff --git a/packages/stripe/CHANGELOG.md b/packages/stripe/CHANGELOG.md index efd01267f..556187d68 100644 --- a/packages/stripe/CHANGELOG.md +++ b/packages/stripe/CHANGELOG.md @@ -1,3 +1,7 @@ +## 10.1.2 + + - Update a dependency to the latest release. + ## 10.1.1 **Fixes** diff --git a/packages/stripe/pubspec.yaml b/packages/stripe/pubspec.yaml index eb3d0756e..a5bcbc36d 100644 --- a/packages/stripe/pubspec.yaml +++ b/packages/stripe/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_stripe description: Flutter library for Stripe. Supports PaymentSheets, Apple & Google Pay, SCA, PSD2 and much more. -version: 10.1.1 +version: 10.1.2 homepage: https://github.com/flutter-stripe/flutter_stripe repository: https://github.com/flutter-stripe/flutter_stripe @@ -24,7 +24,7 @@ dependencies: meta: ^1.8.0 stripe_android: ^10.1.1 stripe_ios: ^10.1.0 - stripe_platform_interface: ^10.1.1 + stripe_platform_interface: ^10.2.0 dev_dependencies: flutter_test: sdk: flutter diff --git a/packages/stripe_platform_interface/CHANGELOG.md b/packages/stripe_platform_interface/CHANGELOG.md index e5a39ffda..9986cff0f 100644 --- a/packages/stripe_platform_interface/CHANGELOG.md +++ b/packages/stripe_platform_interface/CHANGELOG.md @@ -1,3 +1,18 @@ +## 10.2.0 + + - **FIX**: add bankidentifiercode to ideal paymentdata (#1522). + - **FIX**: #1459 allow image to be null (#1466). + - **FIX**: #1409 send usesDeprecatedTokenFlow to stripe platform (#1410). + - **FIX**: #1246 handle empty params on confirmPayment (#1286). + - **FIX**: #1250 incorrectly providing amount to confirmplatformpaysetupintent params (#1255). + - **FIX**: apple pay (#1202). + - **FIX**: timeout payment sheet (#1161). + - **FIX**: implemented handleURLCallback method for iOS iDeal payment. (#939). + - **FEAT**: add retrieveSetupIntent (#1302). + - **FEAT**: release versions (#1283). + - **FEAT**: release 9.2.1 (#1262). + - **FEAT**: stripe js (#1052). + ## 10.1.1 - Fix #1639 cashapp payments diff --git a/packages/stripe_platform_interface/pubspec.yaml b/packages/stripe_platform_interface/pubspec.yaml index 14a23cd76..5d23d70b7 100644 --- a/packages/stripe_platform_interface/pubspec.yaml +++ b/packages/stripe_platform_interface/pubspec.yaml @@ -1,6 +1,6 @@ name: stripe_platform_interface description: Platform interface for stripe sdk -version: 10.1.1 +version: 10.2.0 repository: https://github.com/flutter-stripe/flutter_stripe homepage: https://pub.dev/packages/flutter_stripe diff --git a/packages/stripe_web/CHANGELOG.md b/packages/stripe_web/CHANGELOG.md index 425986c4d..550bbf7a6 100644 --- a/packages/stripe_web/CHANGELOG.md +++ b/packages/stripe_web/CHANGELOG.md @@ -1,3 +1,7 @@ +## 5.1.1 + + - Update a dependency to the latest release. + ## 5.1.0 **Features** diff --git a/packages/stripe_web/pubspec.yaml b/packages/stripe_web/pubspec.yaml index ba954bba0..6e25f619c 100644 --- a/packages/stripe_web/pubspec.yaml +++ b/packages/stripe_web/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_stripe_web description: Stripe sdk bindings for the Flutter web platform. This package contains the implementation of the platform interface for web. -version: 5.1.0 +version: 5.1.1 homepage: https://github.com/flutter-stripe/flutter_stripe environment: @@ -13,7 +13,7 @@ dependencies: flutter_web_plugins: sdk: flutter freezed_annotation: ^2.0.3 - stripe_platform_interface: ^10.1.1 + stripe_platform_interface: ^10.2.0 js: ^0.6.3 stripe_js: ^3.4.0 From d28609862319f9b3d705493eeb10922df74c4aa2 Mon Sep 17 00:00:00 2001 From: Fernando Luca de Tena Date: Thu, 9 May 2024 14:15:24 +0200 Subject: [PATCH 3/5] Added info to changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7df87579c..56d3ab103 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,8 @@ Packages with dependency updates only: #### `stripe_platform_interface` - `v10.2.0` + - **FIX**: Not Getting Card's Fingerprint in Flutter (#707). + - **FIX**: validate with fingerprint (#688). - **FIX**: add bankidentifiercode to ideal paymentdata (#1522). - **FIX**: #1459 allow image to be null (#1466). - **FIX**: #1409 send usesDeprecatedTokenFlow to stripe platform (#1410). From 337c34284ba97c11fa33825e6cfa2ac6c10314a8 Mon Sep 17 00:00:00 2001 From: Fernando Luca de Tena Date: Thu, 9 May 2024 23:10:30 +0200 Subject: [PATCH 4/5] Fixed Type cast fails on Customer Sheet cancel. Issue: https://github.com/flutter-stripe/flutter_stripe/issues/1721 --- .../lib/src/models/customer_sheet.dart | 2 +- .../src/models/customer_sheet.freezed.dart | 24 +++++++++---------- .../lib/src/models/customer_sheet.g.dart | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/stripe_platform_interface/lib/src/models/customer_sheet.dart b/packages/stripe_platform_interface/lib/src/models/customer_sheet.dart index c5869c9d4..e8801b61c 100644 --- a/packages/stripe_platform_interface/lib/src/models/customer_sheet.dart +++ b/packages/stripe_platform_interface/lib/src/models/customer_sheet.dart @@ -93,7 +93,7 @@ class CustomerSheetResult with _$CustomerSheetResult { PaymentMethod? paymentMethod, /// The error that occurred - StripeError? error, + LocalizedErrorMessage? error, }) = _CustomerSheetResult; factory CustomerSheetResult.fromJson(Map json) => diff --git a/packages/stripe_platform_interface/lib/src/models/customer_sheet.freezed.dart b/packages/stripe_platform_interface/lib/src/models/customer_sheet.freezed.dart index 4fcebe212..549d65c67 100644 --- a/packages/stripe_platform_interface/lib/src/models/customer_sheet.freezed.dart +++ b/packages/stripe_platform_interface/lib/src/models/customer_sheet.freezed.dart @@ -865,7 +865,7 @@ mixin _$CustomerSheetResult { PaymentMethod? get paymentMethod => throw _privateConstructorUsedError; /// The error that occurred - StripeError? get error => throw _privateConstructorUsedError; + LocalizedErrorMessage? get error => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) @@ -882,11 +882,11 @@ abstract class $CustomerSheetResultCopyWith<$Res> { $Res call( {PaymentSheetPaymentOption? paymentOption, PaymentMethod? paymentMethod, - StripeError? error}); + LocalizedErrorMessage? error}); $PaymentSheetPaymentOptionCopyWith<$Res>? get paymentOption; $PaymentMethodCopyWith<$Res>? get paymentMethod; - $StripeErrorCopyWith? get error; + $LocalizedErrorMessageCopyWith<$Res>? get error; } /// @nodoc @@ -918,7 +918,7 @@ class _$CustomerSheetResultCopyWithImpl<$Res, $Val extends CustomerSheetResult> error: freezed == error ? _value.error : error // ignore: cast_nullable_to_non_nullable - as StripeError?, + as LocalizedErrorMessage?, ) as $Val); } @@ -949,12 +949,12 @@ class _$CustomerSheetResultCopyWithImpl<$Res, $Val extends CustomerSheetResult> @override @pragma('vm:prefer-inline') - $StripeErrorCopyWith? get error { + $LocalizedErrorMessageCopyWith<$Res>? get error { if (_value.error == null) { return null; } - return $StripeErrorCopyWith(_value.error!, (value) { + return $LocalizedErrorMessageCopyWith<$Res>(_value.error!, (value) { return _then(_value.copyWith(error: value) as $Val); }); } @@ -971,14 +971,14 @@ abstract class _$$CustomerSheetResultImplCopyWith<$Res> $Res call( {PaymentSheetPaymentOption? paymentOption, PaymentMethod? paymentMethod, - StripeError? error}); + LocalizedErrorMessage? error}); @override $PaymentSheetPaymentOptionCopyWith<$Res>? get paymentOption; @override $PaymentMethodCopyWith<$Res>? get paymentMethod; @override - $StripeErrorCopyWith? get error; + $LocalizedErrorMessageCopyWith<$Res>? get error; } /// @nodoc @@ -1008,7 +1008,7 @@ class __$$CustomerSheetResultImplCopyWithImpl<$Res> error: freezed == error ? _value.error : error // ignore: cast_nullable_to_non_nullable - as StripeError?, + as LocalizedErrorMessage?, )); } } @@ -1033,7 +1033,7 @@ class _$CustomerSheetResultImpl implements _CustomerSheetResult { /// The error that occurred @override - final StripeError? error; + final LocalizedErrorMessage? error; @override String toString() { @@ -1076,7 +1076,7 @@ abstract class _CustomerSheetResult implements CustomerSheetResult { const factory _CustomerSheetResult( {final PaymentSheetPaymentOption? paymentOption, final PaymentMethod? paymentMethod, - final StripeError? error}) = _$CustomerSheetResultImpl; + final LocalizedErrorMessage? error}) = _$CustomerSheetResultImpl; factory _CustomerSheetResult.fromJson(Map json) = _$CustomerSheetResultImpl.fromJson; @@ -1092,7 +1092,7 @@ abstract class _CustomerSheetResult implements CustomerSheetResult { @override /// The error that occurred - StripeError? get error; + LocalizedErrorMessage? get error; @override @JsonKey(ignore: true) _$$CustomerSheetResultImplCopyWith<_$CustomerSheetResultImpl> get copyWith => diff --git a/packages/stripe_platform_interface/lib/src/models/customer_sheet.g.dart b/packages/stripe_platform_interface/lib/src/models/customer_sheet.g.dart index 819878538..93ee80f7f 100644 --- a/packages/stripe_platform_interface/lib/src/models/customer_sheet.g.dart +++ b/packages/stripe_platform_interface/lib/src/models/customer_sheet.g.dart @@ -128,7 +128,7 @@ _$CustomerSheetResultImpl _$$CustomerSheetResultImplFromJson( json['paymentMethod'] as Map), error: json['error'] == null ? null - : StripeError.fromJson( + : LocalizedErrorMessage.fromJson( json['error'] as Map), ); From 4374526be94e146c87fbc87238e8aa80390a9955 Mon Sep 17 00:00:00 2001 From: Fernando Luca de Tena Date: Thu, 9 May 2024 23:17:30 +0200 Subject: [PATCH 5/5] updated changelog --- CHANGELOG.md | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 56d3ab103..4ae0bccd3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,19 +32,7 @@ Packages with dependency updates only: - **FIX**: Not Getting Card's Fingerprint in Flutter (#707). - **FIX**: validate with fingerprint (#688). - - **FIX**: add bankidentifiercode to ideal paymentdata (#1522). - - **FIX**: #1459 allow image to be null (#1466). - - **FIX**: #1409 send usesDeprecatedTokenFlow to stripe platform (#1410). - - **FIX**: #1246 handle empty params on confirmPayment (#1286). - - **FIX**: #1250 incorrectly providing amount to confirmplatformpaysetupintent params (#1255). - - **FIX**: apple pay (#1202). - - **FIX**: timeout payment sheet (#1161). - - **FIX**: implemented handleURLCallback method for iOS iDeal payment. (#939). - - **FEAT**: add retrieveSetupIntent (#1302). - - **FEAT**: release versions (#1283). - - **FEAT**: release 9.2.1 (#1262). - - **FEAT**: stripe js (#1052). - + - **FIX**: Fixed Type cast fails on Customer Sheet cancel (#1721) ## 2024-03-26