ChargeUpdateOptions.fromJson constructor

ChargeUpdateOptions.fromJson(
  1. Object? json
)

Implementation

factory ChargeUpdateOptions.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return ChargeUpdateOptions(
    customer: map['customer'] == null ? null : (map['customer'] as String),
    description:
        map['description'] == null ? null : (map['description'] as String),
    expand: map['expand'] == null
        ? null
        : (map['expand'] as List<Object?>)
            .map((el) => (el as String))
            .toList(),
    fraudDetails: map['fraud_details'] == null
        ? null
        : ChargeUpdateOptionsFraudDetails.fromJson(map['fraud_details']),
    metadata: map['metadata'] == null
        ? null
        : (map['metadata'] as Map).cast<String, Object?>().map((
              key,
              value,
            ) =>
                MapEntry(
                  key,
                  (value as String),
                )),
    receiptEmail: map['receipt_email'] == null
        ? null
        : (map['receipt_email'] as String),
    shipping: map['shipping'] == null
        ? null
        : ChargeCreateOptionsShipping.fromJson(map['shipping']),
    transferGroup: map['transfer_group'] == null
        ? null
        : (map['transfer_group'] as String),
  );
}