FeeRefund.fromJson constructor

FeeRefund.fromJson(
  1. Object? json
)

Implementation

factory FeeRefund.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return FeeRefund(
    amount: (map['amount'] as num).toInt(),
    balanceTransaction: map['balance_transaction'] == null
        ? null
        : BalanceTransactionOrId.fromJson(map['balance_transaction']),
    created:
        DateTime.fromMillisecondsSinceEpoch((map['created'] as int).toInt()),
    currency: (map['currency'] as String),
    fee: ApplicationFeeOrId.fromJson(map['fee']),
    id: (map['id'] as String),
    metadata: map['metadata'] == null
        ? null
        : (map['metadata'] as Map).cast<String, Object?>().map((
              key,
              value,
            ) =>
                MapEntry(
                  key,
                  (value as String),
                )),
  );
}