From 495a7fa3f5bb7f89074d3ca4db766a49fc84c101 Mon Sep 17 00:00:00 2001 From: Jonas Wanke Date: Mon, 24 Jul 2023 09:46:03 +0200 Subject: [PATCH 1/4] Run build_runner --- .../lib/src/models/aubecs_form.freezed.dart | 40 +++--- .../src/models/card_field_input.freezed.dart | 96 ++++++------- .../lib/src/models/errors.freezed.dart | 4 +- .../src/models/payment_methods.freezed.dart | 26 ++-- .../lib/src/models/payment_sheet.freezed.dart | 135 +++++++++--------- 5 files changed, 145 insertions(+), 156 deletions(-) diff --git a/packages/stripe_platform_interface/lib/src/models/aubecs_form.freezed.dart b/packages/stripe_platform_interface/lib/src/models/aubecs_form.freezed.dart index 4c7eaa0ab..d7d4c47cf 100644 --- a/packages/stripe_platform_interface/lib/src/models/aubecs_form.freezed.dart +++ b/packages/stripe_platform_interface/lib/src/models/aubecs_form.freezed.dart @@ -56,17 +56,17 @@ abstract class $AubecsFormStyleCopyWith<$Res> { @useResult $Res call( {@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? textColor, + Color? textColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? textErrorColor, + Color? textErrorColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? placeholderColor, + Color? placeholderColor, int? fontSize, int? borderWidth, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? backgroundColor, + Color? backgroundColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? borderColor, + Color? borderColor, int? borderRadius}); } @@ -139,17 +139,17 @@ abstract class _$$_AubecsFormStyleCopyWith<$Res> @useResult $Res call( {@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? textColor, + Color? textColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? textErrorColor, + Color? textErrorColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? placeholderColor, + Color? placeholderColor, int? fontSize, int? borderWidth, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? backgroundColor, + Color? backgroundColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? borderColor, + Color? borderColor, int? borderRadius}); } @@ -216,17 +216,17 @@ class __$$_AubecsFormStyleCopyWithImpl<$Res> class _$_AubecsFormStyle implements _AubecsFormStyle { const _$_AubecsFormStyle( {@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.textColor, + this.textColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.textErrorColor, + this.textErrorColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.placeholderColor, + this.placeholderColor, this.fontSize, this.borderWidth, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.backgroundColor, + this.backgroundColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.borderColor, + this.borderColor, this.borderRadius}); factory _$_AubecsFormStyle.fromJson(Map json) => @@ -320,17 +320,17 @@ class _$_AubecsFormStyle implements _AubecsFormStyle { abstract class _AubecsFormStyle implements AubecsFormStyle { const factory _AubecsFormStyle( {@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? textColor, + final Color? textColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? textErrorColor, + final Color? textErrorColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? placeholderColor, + final Color? placeholderColor, final int? fontSize, final int? borderWidth, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? backgroundColor, + final Color? backgroundColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? borderColor, + final Color? borderColor, final int? borderRadius}) = _$_AubecsFormStyle; factory _AubecsFormStyle.fromJson(Map json) = diff --git a/packages/stripe_platform_interface/lib/src/models/card_field_input.freezed.dart b/packages/stripe_platform_interface/lib/src/models/card_field_input.freezed.dart index 77592ea3f..494594877 100644 --- a/packages/stripe_platform_interface/lib/src/models/card_field_input.freezed.dart +++ b/packages/stripe_platform_interface/lib/src/models/card_field_input.freezed.dart @@ -60,20 +60,20 @@ abstract class $CardStyleCopyWith<$Res> { $Res call( {int? borderWidth, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? backgroundColor, + Color? backgroundColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? borderColor, + Color? borderColor, int? borderRadius, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? cursorColor, + Color? cursorColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? textColor, + Color? textColor, int? fontSize, String? fontFamily, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? textErrorColor, + Color? textErrorColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? placeholderColor}); + Color? placeholderColor}); } /// @nodoc @@ -156,20 +156,20 @@ abstract class _$$_CardStyleConstructorCopyWith<$Res> $Res call( {int? borderWidth, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? backgroundColor, + Color? backgroundColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? borderColor, + Color? borderColor, int? borderRadius, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? cursorColor, + Color? cursorColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? textColor, + Color? textColor, int? fontSize, String? fontFamily, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? textErrorColor, + Color? textErrorColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? placeholderColor}); + Color? placeholderColor}); } /// @nodoc @@ -246,20 +246,20 @@ class _$_CardStyleConstructor extends _CardStyleConstructor { _$_CardStyleConstructor( {this.borderWidth, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.backgroundColor, + this.backgroundColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.borderColor, + this.borderColor, this.borderRadius, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.cursorColor, + this.cursorColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.textColor, + this.textColor, this.fontSize, this.fontFamily, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.textErrorColor, + this.textErrorColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.placeholderColor}) + this.placeholderColor}) : super._(); factory _$_CardStyleConstructor.fromJson(Map json) => @@ -367,20 +367,20 @@ abstract class _CardStyleConstructor extends CardStyle { factory _CardStyleConstructor( {final int? borderWidth, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? backgroundColor, + final Color? backgroundColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? borderColor, + final Color? borderColor, final int? borderRadius, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? cursorColor, + final Color? cursorColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? textColor, + final Color? textColor, final int? fontSize, final String? fontFamily, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? textErrorColor, + final Color? textErrorColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? placeholderColor}) = _$_CardStyleConstructor; + final Color? placeholderColor}) = _$_CardStyleConstructor; _CardStyleConstructor._() : super._(); factory _CardStyleConstructor.fromJson(Map json) = @@ -472,20 +472,20 @@ abstract class $CardFormStyleCopyWith<$Res> { @useResult $Res call( {@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? backgroundColor, + Color? backgroundColor, int? borderWidth, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? borderColor, + Color? borderColor, int? borderRadius, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? cursorColor, + Color? cursorColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? textColor, + Color? textColor, int? fontSize, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? textErrorColor, + Color? textErrorColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? placeholderColor}); + Color? placeholderColor}); } /// @nodoc @@ -563,20 +563,20 @@ abstract class _$$_CardFormStyleConstructorCopyWith<$Res> @useResult $Res call( {@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? backgroundColor, + Color? backgroundColor, int? borderWidth, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? borderColor, + Color? borderColor, int? borderRadius, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? cursorColor, + Color? cursorColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? textColor, + Color? textColor, int? fontSize, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? textErrorColor, + Color? textErrorColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? placeholderColor}); + Color? placeholderColor}); } /// @nodoc @@ -647,20 +647,20 @@ class __$$_CardFormStyleConstructorCopyWithImpl<$Res> class _$_CardFormStyleConstructor extends _CardFormStyleConstructor { _$_CardFormStyleConstructor( {@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.backgroundColor, + this.backgroundColor, this.borderWidth, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.borderColor, + this.borderColor, this.borderRadius, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.cursorColor, + this.cursorColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.textColor, + this.textColor, this.fontSize, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.textErrorColor, + this.textErrorColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.placeholderColor}) + this.placeholderColor}) : super._(); factory _$_CardFormStyleConstructor.fromJson(Map json) => @@ -761,20 +761,20 @@ class _$_CardFormStyleConstructor extends _CardFormStyleConstructor { abstract class _CardFormStyleConstructor extends CardFormStyle { factory _CardFormStyleConstructor( {@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? backgroundColor, + final Color? backgroundColor, final int? borderWidth, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? borderColor, + final Color? borderColor, final int? borderRadius, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? cursorColor, + final Color? cursorColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? textColor, + final Color? textColor, final int? fontSize, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? textErrorColor, + final Color? textErrorColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? placeholderColor}) = _$_CardFormStyleConstructor; + final Color? placeholderColor}) = _$_CardFormStyleConstructor; _CardFormStyleConstructor._() : super._(); factory _CardFormStyleConstructor.fromJson(Map json) = diff --git a/packages/stripe_platform_interface/lib/src/models/errors.freezed.dart b/packages/stripe_platform_interface/lib/src/models/errors.freezed.dart index c6c5fc9a9..615488b71 100644 --- a/packages/stripe_platform_interface/lib/src/models/errors.freezed.dart +++ b/packages/stripe_platform_interface/lib/src/models/errors.freezed.dart @@ -117,7 +117,7 @@ class _$_StripeErrorGeneric implements _StripeErrorGeneric { const _$_StripeErrorGeneric( {required this.message, @JsonKey(fromJson: _dataFromJson, toJson: _dataToJson) - required this.code}); + required this.code}); factory _$_StripeErrorGeneric.fromJson(Map json) => _$$_StripeErrorGenericFromJson(json); @@ -166,7 +166,7 @@ abstract class _StripeErrorGeneric implements StripeError { const factory _StripeErrorGeneric( {required final String message, @JsonKey(fromJson: _dataFromJson, toJson: _dataToJson) - required final T code}) = _$_StripeErrorGeneric; + required final T code}) = _$_StripeErrorGeneric; factory _StripeErrorGeneric.fromJson(Map json) = _$_StripeErrorGeneric.fromJson; 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 c47b978ea..7d1a77c29 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 @@ -574,24 +574,16 @@ abstract class _PaymentMethod implements PaymentMethod { required final bool livemode, required final String paymentMethodType, required final BillingDetails billingDetails, - @JsonKey(name: 'Card') - required final Card card, - @JsonKey(name: 'SepaDebit') - required final SepaDebit sepaDebit, - @JsonKey(name: 'BacsDebit') - required final BacsDebit bacsDebit, - @JsonKey(name: 'AuBecsDebit') - required final AuBecsDebit auBecsDebit, - @JsonKey(name: 'Sofort') - required final Sofort sofort, - @JsonKey(name: 'Ideal') - required final Ideal ideal, - @JsonKey(name: 'Fpx') - required final Fpx fpx, - @JsonKey(name: 'Upi') - required final Upi upi, + @JsonKey(name: 'Card') required final Card card, + @JsonKey(name: 'SepaDebit') required final SepaDebit sepaDebit, + @JsonKey(name: 'BacsDebit') required final BacsDebit bacsDebit, + @JsonKey(name: 'AuBecsDebit') required final AuBecsDebit auBecsDebit, + @JsonKey(name: 'Sofort') required final Sofort sofort, + @JsonKey(name: 'Ideal') required final Ideal ideal, + @JsonKey(name: 'Fpx') required final Fpx fpx, + @JsonKey(name: 'Upi') required final Upi upi, @JsonKey(name: 'USBankAccount') - required final UsBankAccount usBankAccount, + required final UsBankAccount usBankAccount, final String? customerId}) = _$_PaymentMethod; factory _PaymentMethod.fromJson(Map json) = diff --git a/packages/stripe_platform_interface/lib/src/models/payment_sheet.freezed.dart b/packages/stripe_platform_interface/lib/src/models/payment_sheet.freezed.dart index 6d2178604..d1cef29a6 100644 --- a/packages/stripe_platform_interface/lib/src/models/payment_sheet.freezed.dart +++ b/packages/stripe_platform_interface/lib/src/models/payment_sheet.freezed.dart @@ -625,13 +625,12 @@ abstract class _SetupParameters implements SetupPaymentSheetParameters { final String? setupIntentClientSecret, final String? merchantDisplayName, final PaymentSheetApplePay? applePay, - @JsonKey(toJson: UserInterfaceStyleKey.toJson) - final ThemeMode? style, + @JsonKey(toJson: UserInterfaceStyleKey.toJson) final ThemeMode? style, final PaymentSheetGooglePay? googlePay, final bool allowsDelayedPaymentMethods, final PaymentSheetAppearance? appearance, @JsonKey(name: 'defaultBillingDetails') - final BillingDetails? billingDetails, + final BillingDetails? billingDetails, final String? returnURL, final BillingDetailsCollectionConfiguration? billingDetailsCollectionConfiguration}) = _$_SetupParameters; @@ -775,7 +774,7 @@ abstract class $PaymentSheetApplePayCopyWith<$Res> { PlatformButtonType? buttonType, PaymentRequestType? request, @JsonKey(includeFromJson: false, includeToJson: false) - OnOrderTracking? setOrderTracking}); + OnOrderTracking? setOrderTracking}); $PaymentRequestTypeCopyWith<$Res>? get request; } @@ -851,7 +850,7 @@ abstract class _$$_PaymentSheetApplePayCopyWith<$Res> PlatformButtonType? buttonType, PaymentRequestType? request, @JsonKey(includeFromJson: false, includeToJson: false) - OnOrderTracking? setOrderTracking}); + OnOrderTracking? setOrderTracking}); @override $PaymentRequestTypeCopyWith<$Res>? get request; @@ -909,7 +908,7 @@ class _$_PaymentSheetApplePay implements _PaymentSheetApplePay { this.buttonType, this.request, @JsonKey(includeFromJson: false, includeToJson: false) - this.setOrderTracking}) + this.setOrderTracking}) : _cartItems = cartItems; factory _$_PaymentSheetApplePay.fromJson(Map json) => @@ -1003,7 +1002,7 @@ abstract class _PaymentSheetApplePay implements PaymentSheetApplePay { final PlatformButtonType? buttonType, final PaymentRequestType? request, @JsonKey(includeFromJson: false, includeToJson: false) - final OnOrderTracking? setOrderTracking}) = _$_PaymentSheetApplePay; + final OnOrderTracking? setOrderTracking}) = _$_PaymentSheetApplePay; factory _PaymentSheetApplePay.fromJson(Map json) = _$_PaymentSheetApplePay.fromJson; @@ -1559,27 +1558,27 @@ abstract class $PaymentSheetAppearanceColorsCopyWith<$Res> { @useResult $Res call( {@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? primary, + Color? primary, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? background, + Color? background, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? componentBackground, + Color? componentBackground, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? componentBorder, + Color? componentBorder, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? componentDivider, + Color? componentDivider, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? componentText, + Color? componentText, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? primaryText, + Color? primaryText, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? secondaryText, + Color? secondaryText, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? placeholderText, + Color? placeholderText, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? icon, + Color? icon, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? error}); + Color? error}); } /// @nodoc @@ -1668,27 +1667,27 @@ abstract class _$$_PaymentSheetAppearanceColorsCopyWith<$Res> @useResult $Res call( {@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? primary, + Color? primary, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? background, + Color? background, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? componentBackground, + Color? componentBackground, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? componentBorder, + Color? componentBorder, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? componentDivider, + Color? componentDivider, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? componentText, + Color? componentText, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? primaryText, + Color? primaryText, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? secondaryText, + Color? secondaryText, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? placeholderText, + Color? placeholderText, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? icon, + Color? icon, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? error}); + Color? error}); } /// @nodoc @@ -1770,27 +1769,26 @@ class __$$_PaymentSheetAppearanceColorsCopyWithImpl<$Res> class _$_PaymentSheetAppearanceColors implements _PaymentSheetAppearanceColors { const _$_PaymentSheetAppearanceColors( {@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.primary, + this.primary, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.background, + this.background, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.componentBackground, + this.componentBackground, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.componentBorder, + this.componentBorder, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.componentDivider, + this.componentDivider, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.componentText, + this.componentText, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.primaryText, + this.primaryText, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.secondaryText, + this.secondaryText, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.placeholderText, + this.placeholderText, + @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) this.icon, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.icon, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.error}); + this.error}); factory _$_PaymentSheetAppearanceColors.fromJson(Map json) => _$$_PaymentSheetAppearanceColorsFromJson(json); @@ -1920,27 +1918,27 @@ abstract class _PaymentSheetAppearanceColors implements PaymentSheetAppearanceColors { const factory _PaymentSheetAppearanceColors( {@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? primary, + final Color? primary, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? background, + final Color? background, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? componentBackground, + final Color? componentBackground, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? componentBorder, + final Color? componentBorder, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? componentDivider, + final Color? componentDivider, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? componentText, + final Color? componentText, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? primaryText, + final Color? primaryText, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? secondaryText, + final Color? secondaryText, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? placeholderText, + final Color? placeholderText, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? icon, + final Color? icon, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? error}) = _$_PaymentSheetAppearanceColors; + final Color? error}) = _$_PaymentSheetAppearanceColors; factory _PaymentSheetAppearanceColors.fromJson(Map json) = _$_PaymentSheetAppearanceColors.fromJson; @@ -2257,7 +2255,7 @@ abstract class $PaymentSheetShadowParamsCopyWith<$Res> { @useResult $Res call( {@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? color, + Color? color, double? opacity, PaymentSheetShadowOffset? offset}); @@ -2322,7 +2320,7 @@ abstract class _$$_PaymentSheetShadowParamsCopyWith<$Res> @useResult $Res call( {@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? color, + Color? color, double? opacity, PaymentSheetShadowOffset? offset}); @@ -2369,7 +2367,7 @@ class __$$_PaymentSheetShadowParamsCopyWithImpl<$Res> class _$_PaymentSheetShadowParams implements _PaymentSheetShadowParams { const _$_PaymentSheetShadowParams( {@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.color, + this.color, this.opacity, this.offset}); @@ -2426,7 +2424,7 @@ class _$_PaymentSheetShadowParams implements _PaymentSheetShadowParams { abstract class _PaymentSheetShadowParams implements PaymentSheetShadowParams { const factory _PaymentSheetShadowParams( {@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? color, + final Color? color, final double? opacity, final PaymentSheetShadowOffset? offset}) = _$_PaymentSheetShadowParams; @@ -3320,11 +3318,11 @@ abstract class $PaymentSheetPrimaryButtonThemeColorsCopyWith<$Res> { @useResult $Res call( {@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? background, + Color? background, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? text, + Color? text, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? border}); + Color? border}); } /// @nodoc @@ -3373,11 +3371,11 @@ abstract class _$$_PaymentSheetPrimaryButtonThemeColorsCopyWith<$Res> @useResult $Res call( {@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? background, + Color? background, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? text, + Color? text, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? border}); + Color? border}); } /// @nodoc @@ -3420,11 +3418,10 @@ class _$_PaymentSheetPrimaryButtonThemeColors implements _PaymentSheetPrimaryButtonThemeColors { const _$_PaymentSheetPrimaryButtonThemeColors( {@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.background, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.text, + this.background, + @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) this.text, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.border}); + this.border}); factory _$_PaymentSheetPrimaryButtonThemeColors.fromJson( Map json) => @@ -3485,11 +3482,11 @@ abstract class _PaymentSheetPrimaryButtonThemeColors implements PaymentSheetPrimaryButtonThemeColors { const factory _PaymentSheetPrimaryButtonThemeColors( {@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? background, + final Color? background, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? text, + final Color? text, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? border}) = _$_PaymentSheetPrimaryButtonThemeColors; + final Color? border}) = _$_PaymentSheetPrimaryButtonThemeColors; factory _PaymentSheetPrimaryButtonThemeColors.fromJson( Map json) = From 8f522ece57e9b473767d0789f59a68d6dab64d94 Mon Sep 17 00:00:00 2001 From: Jonas Wanke Date: Mon, 24 Jul 2023 17:46:47 +0200 Subject: [PATCH 2/4] Add PayPal to PaymentMethodType --- .../stripe_platform_interface/lib/src/models/ach_params.g.dart | 1 + .../lib/src/models/payment_methods.dart | 1 + .../stripe_platform_interface/lib/src/models/setup_intent.g.dart | 1 + 3 files changed, 3 insertions(+) diff --git a/packages/stripe_platform_interface/lib/src/models/ach_params.g.dart b/packages/stripe_platform_interface/lib/src/models/ach_params.g.dart index 2f0ecfdee..f576efabf 100644 --- a/packages/stripe_platform_interface/lib/src/models/ach_params.g.dart +++ b/packages/stripe_platform_interface/lib/src/models/ach_params.g.dart @@ -41,6 +41,7 @@ const _$PaymentMethodTypeEnumMap = { PaymentMethodType.Eps: 'Eps', PaymentMethodType.Bancontact: 'Bancontact', PaymentMethodType.Oxxo: 'Oxxo', + PaymentMethodType.PayPal: 'PayPal', PaymentMethodType.Sofort: 'Sofort', PaymentMethodType.Upi: 'Upi', PaymentMethodType.USBankAccount: 'USBankAccount', 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 72cd426e4..5cf68df95 100644 --- a/packages/stripe_platform_interface/lib/src/models/payment_methods.dart +++ b/packages/stripe_platform_interface/lib/src/models/payment_methods.dart @@ -310,6 +310,7 @@ enum PaymentMethodType { Eps, Bancontact, Oxxo, + PayPal, Sofort, Upi, USBankAccount, diff --git a/packages/stripe_platform_interface/lib/src/models/setup_intent.g.dart b/packages/stripe_platform_interface/lib/src/models/setup_intent.g.dart index d05d96b16..64b16f6f6 100644 --- a/packages/stripe_platform_interface/lib/src/models/setup_intent.g.dart +++ b/packages/stripe_platform_interface/lib/src/models/setup_intent.g.dart @@ -66,6 +66,7 @@ const _$PaymentMethodTypeEnumMap = { PaymentMethodType.Eps: 'Eps', PaymentMethodType.Bancontact: 'Bancontact', PaymentMethodType.Oxxo: 'Oxxo', + PaymentMethodType.PayPal: 'PayPal', PaymentMethodType.Sofort: 'Sofort', PaymentMethodType.Upi: 'Upi', PaymentMethodType.USBankAccount: 'USBankAccount', From 9af26f4ede89bddcb54ef8662cf758e49df5a313 Mon Sep 17 00:00:00 2001 From: Jonas Wanke Date: Mon, 24 Jul 2023 17:47:45 +0200 Subject: [PATCH 3/4] Fix MandateDataCustomerAcceptance serialization --- .../lib/src/models/payment_methods.dart | 31 ++++++++++++++++--- .../src/models/payment_methods.freezed.dart | 30 +++--------------- .../lib/src/models/payment_methods.g.dart | 15 --------- 3 files changed, 31 insertions(+), 45 deletions(-) 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 5cf68df95..53d3fcfe5 100644 --- a/packages/stripe_platform_interface/lib/src/models/payment_methods.dart +++ b/packages/stripe_platform_interface/lib/src/models/payment_methods.dart @@ -784,14 +784,37 @@ class MandateData with _$MandateData { ///Information about the online mandate class MandateDataCustomerAcceptance with _$MandateDataCustomerAcceptance { - @JsonSerializable(explicitToJson: true) const factory MandateDataCustomerAcceptance({ /// Online data regarding the mandate. MandateDataOnlineData? ipAddress, }) = _MandateDataCustomerAcceptance; - - factory MandateDataCustomerAcceptance.fromJson(Map json) => - _$MandateDataCustomerAcceptanceFromJson(json); + const MandateDataCustomerAcceptance._(); + + factory MandateDataCustomerAcceptance.fromJson(Map json) { + final type = json['type'] as String?; + if (type != 'online') { + throw ArgumentError.value( + type, + 'type', + 'Only customer acceptance of type online is supported.', + ); + } + + return _MandateDataCustomerAcceptance( + ipAddress: json['online'] == null + ? null + : MandateDataOnlineData.fromJson( + json['online'] as Map, + ), + ); + } + + Map toJson() { + return { + 'type': 'online', + 'online': ipAddress?.toJson(), + }; + } } @freezed 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 7d1a77c29..3a6b9663e 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 @@ -12735,17 +12735,11 @@ abstract class _MandateData implements MandateData { throw _privateConstructorUsedError; } -MandateDataCustomerAcceptance _$MandateDataCustomerAcceptanceFromJson( - Map json) { - return _MandateDataCustomerAcceptance.fromJson(json); -} - /// @nodoc mixin _$MandateDataCustomerAcceptance { /// Online data regarding the mandate. MandateDataOnlineData? get ipAddress => throw _privateConstructorUsedError; - Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) $MandateDataCustomerAcceptanceCopyWith get copyWith => throw _privateConstructorUsedError; @@ -12842,14 +12836,8 @@ class __$$_MandateDataCustomerAcceptanceCopyWithImpl<$Res> /// @nodoc -@JsonSerializable(explicitToJson: true) -class _$_MandateDataCustomerAcceptance - implements _MandateDataCustomerAcceptance { - const _$_MandateDataCustomerAcceptance({this.ipAddress}); - - factory _$_MandateDataCustomerAcceptance.fromJson( - Map json) => - _$$_MandateDataCustomerAcceptanceFromJson(json); +class _$_MandateDataCustomerAcceptance extends _MandateDataCustomerAcceptance { + const _$_MandateDataCustomerAcceptance({this.ipAddress}) : super._(); /// Online data regarding the mandate. @override @@ -12869,7 +12857,6 @@ class _$_MandateDataCustomerAcceptance other.ipAddress == ipAddress)); } - @JsonKey(ignore: true) @override int get hashCode => Object.hash(runtimeType, ipAddress); @@ -12879,23 +12866,14 @@ class _$_MandateDataCustomerAcceptance _$$_MandateDataCustomerAcceptanceCopyWith<_$_MandateDataCustomerAcceptance> get copyWith => __$$_MandateDataCustomerAcceptanceCopyWithImpl< _$_MandateDataCustomerAcceptance>(this, _$identity); - - @override - Map toJson() { - return _$$_MandateDataCustomerAcceptanceToJson( - this, - ); - } } abstract class _MandateDataCustomerAcceptance - implements MandateDataCustomerAcceptance { + extends MandateDataCustomerAcceptance { const factory _MandateDataCustomerAcceptance( {final MandateDataOnlineData? ipAddress}) = _$_MandateDataCustomerAcceptance; - - factory _MandateDataCustomerAcceptance.fromJson(Map json) = - _$_MandateDataCustomerAcceptance.fromJson; + const _MandateDataCustomerAcceptance._() : super._(); @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 223a41621..e27a4726f 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 @@ -828,21 +828,6 @@ Map _$$_MandateDataToJson(_$_MandateData instance) => 'customerAcceptance': instance.customerAcceptance?.toJson(), }; -_$_MandateDataCustomerAcceptance _$$_MandateDataCustomerAcceptanceFromJson( - Map json) => - _$_MandateDataCustomerAcceptance( - ipAddress: json['ipAddress'] == null - ? null - : MandateDataOnlineData.fromJson( - json['ipAddress'] as Map), - ); - -Map _$$_MandateDataCustomerAcceptanceToJson( - _$_MandateDataCustomerAcceptance instance) => - { - 'ipAddress': instance.ipAddress?.toJson(), - }; - _$_MandateDataOnlineData _$$_MandateDataOnlineDataFromJson( Map json) => _$_MandateDataOnlineData( From c9dc89a7b57322ed129ff4f1028bb745fd2b5127 Mon Sep 17 00:00:00 2001 From: Jonas Wanke Date: Tue, 1 Aug 2023 08:13:27 +0200 Subject: [PATCH 4/4] Run dart format --- .../lib/src/stripe_platform_interface.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/stripe_platform_interface/lib/src/stripe_platform_interface.dart b/packages/stripe_platform_interface/lib/src/stripe_platform_interface.dart index 3261f2c27..4f1faa4a5 100644 --- a/packages/stripe_platform_interface/lib/src/stripe_platform_interface.dart +++ b/packages/stripe_platform_interface/lib/src/stripe_platform_interface.dart @@ -53,7 +53,8 @@ abstract class StripePlatform extends PlatformInterface { Future isApplePaySupported() async => false; /// Configure the payment sheet using [SetupPaymentSheetParameters] as config. - Future initPaymentSheet(SetupPaymentSheetParameters params); + Future initPaymentSheet( + SetupPaymentSheetParameters params); /// Display the payment sheet. Future presentPaymentSheet({