FinancialConnectionsTransaction.fromJson constructor

FinancialConnectionsTransaction.fromJson(
  1. Object? json
)

Implementation

factory FinancialConnectionsTransaction.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return FinancialConnectionsTransaction(
    account: (map['account'] as String),
    amount: (map['amount'] as num).toInt(),
    currency: (map['currency'] as String),
    description: (map['description'] as String),
    id: (map['id'] as String),
    livemode: (map['livemode'] as bool),
    status: FinancialConnectionsTransactionStatus.fromJson(map['status']),
    statusTransitions:
        BankConnectionsResourceTransactionResourceStatusTransitions.fromJson(
            map['status_transitions']),
    transactedAt: DateTime.fromMillisecondsSinceEpoch(
        (map['transacted_at'] as int).toInt()),
    transactionRefresh: (map['transaction_refresh'] as String),
    updated:
        DateTime.fromMillisecondsSinceEpoch((map['updated'] as int).toInt()),
  );
}