PaymentLinkInvoiceData.fromJson constructor

PaymentLinkInvoiceData.fromJson(
  1. Object? json
)

Implementation

factory PaymentLinkInvoiceData.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return PaymentLinkInvoiceData(
    accountTaxIds: map['account_tax_ids'] == null
        ? null
        : (map['account_tax_ids'] as List<Object?>)
            .map((el) => (el as String))
            .toList(),
    customFields: map['custom_fields'] == null
        ? null
        : (map['custom_fields'] as List<Object?>)
            .map((el) => InvoiceSettingCustomField.fromJson(el))
            .toList(),
    description:
        map['description'] == null ? null : (map['description'] as String),
    footer: map['footer'] == null ? null : (map['footer'] as String),
    issuer: map['issuer'] == null
        ? null
        : SessionLiability.fromJson(map['issuer']),
    metadata: map['metadata'] == null
        ? null
        : (map['metadata'] as Map).cast<String, Object?>().map((
              key,
              value,
            ) =>
                MapEntry(
                  key,
                  (value as String),
                )),
    renderingOptions: map['rendering_options'] == null
        ? null
        : SessionRenderingOptions.fromJson(map['rendering_options']),
  );
}