TreasuryReceivedCredit.fromJson constructor
TreasuryReceivedCredit.fromJson(
- Object? json
Implementation
factory TreasuryReceivedCredit.fromJson(Object? json) {
final map = (json as Map).cast<String, Object?>();
return TreasuryReceivedCredit(
amount: (map['amount'] as num).toInt(),
created:
DateTime.fromMillisecondsSinceEpoch((map['created'] as int).toInt()),
currency: (map['currency'] as String),
description: (map['description'] as String),
failureCode: map['failure_code'] == null
? null
: TreasuryReceivedCreditFailureCode.fromJson(map['failure_code']),
financialAccount: map['financial_account'] == null
? null
: (map['financial_account'] as String),
hostedRegulatoryReceiptUrl: map['hosted_regulatory_receipt_url'] == null
? null
: (map['hosted_regulatory_receipt_url'] as String),
id: (map['id'] as String),
initiatingPaymentMethodDetails:
TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetails
.fromJson(map['initiating_payment_method_details']),
linkedFlows: TreasuryReceivedCreditsResourceLinkedFlows.fromJson(
map['linked_flows']),
livemode: (map['livemode'] as bool),
network: TreasuryReceivedCreditNetwork.fromJson(map['network']),
reversalDetails: map['reversal_details'] == null
? null
: TreasuryReceivedCreditReversalDetails.fromJson(
map['reversal_details']),
status: TreasuryReceivedCreditStatus.fromJson(map['status']),
transaction: map['transaction'] == null
? null
: TreasuryTransactionOrId.fromJson(map['transaction']),
);
}