PaymentLinkPaymentIntentData.fromJson constructor

PaymentLinkPaymentIntentData.fromJson(
  1. Object? json
)

Implementation

factory PaymentLinkPaymentIntentData.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return PaymentLinkPaymentIntentData(
    captureMethod: map['capture_method'] == null
        ? null
        : PaymentLinkPaymentIntentDataCaptureMethod.fromJson(
            map['capture_method']),
    description:
        map['description'] == null ? null : (map['description'] as String),
    metadata: (map['metadata'] as Map).cast<String, Object?>().map((
          key,
          value,
        ) =>
            MapEntry(
              key,
              (value as String),
            )),
    setupFutureUsage: map['setup_future_usage'] == null
        ? null
        : ConfirmationTokenSetupFutureUsage.fromJson(
            map['setup_future_usage']),
    statementDescriptor: map['statement_descriptor'] == null
        ? null
        : (map['statement_descriptor'] as String),
    statementDescriptorSuffix: map['statement_descriptor_suffix'] == null
        ? null
        : (map['statement_descriptor_suffix'] as String),
    transferGroup: map['transfer_group'] == null
        ? null
        : (map['transfer_group'] as String),
  );
}