Skip to content

Commit 8b8d0eb

Browse files
authored
Fix Link display params serialization (#2407)
LinkDisplayParams were serialized using the Dart field names `linkDisplayParams` and `linkDisplay`, while the native iOS and Android PaymentSheet implementations expect `link` and `display`. Add JsonKey annotations to match the native payload fields.
1 parent 4f38dbd commit 8b8d0eb

4 files changed

Lines changed: 38 additions & 32 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ abstract class SetupPaymentSheetParameters with _$SetupPaymentSheetParameters {
6868
PaymentSheetGooglePay? googlePay,
6969

7070
/// Configuration related to Link
71-
LinkDisplayParams? linkDisplayParams,
71+
@JsonKey(name: 'link') LinkDisplayParams? linkDisplayParams,
7272

7373
/// Flag that allows payment methods that do not move money at the send of the checkout.
7474
///
@@ -751,7 +751,7 @@ abstract class CardBrandAcceptance with _$CardBrandAcceptance {
751751
abstract class LinkDisplayParams with _$LinkDisplayParams {
752752
const factory LinkDisplayParams({
753753
/// Display configuration for Link
754-
required LinkDisplay linkDisplay,
754+
@JsonKey(name: 'display') required LinkDisplay linkDisplay,
755755
}) = _LinkDisplayParams;
756756

757757
factory LinkDisplayParams.fromJson(Map<String, Object?> json) =>

0 commit comments

Comments
 (0)