PaymentSourceCreateOptions.fromJson constructor

PaymentSourceCreateOptions.fromJson(
  1. Object? json
)

Implementation

factory PaymentSourceCreateOptions.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return PaymentSourceCreateOptions(
    expand: map['expand'] == null
        ? null
        : (map['expand'] as List<Object?>)
            .map((el) => (el as String))
            .toList(),
    metadata: map['metadata'] == null
        ? null
        : (map['metadata'] as Map).cast<String, Object?>().map((
              key,
              value,
            ) =>
                MapEntry(
                  key,
                  (value as String),
                )),
    source: (map['source'] as String),
    validate: map['validate'] == null ? null : (map['validate'] as bool),
  );
}