PayoutCreateOptions.fromJson constructor
PayoutCreateOptions.fromJson(
- Object? json
Implementation
factory PayoutCreateOptions.fromJson(Object? json) {
final map = (json as Map).cast<String, Object?>();
return PayoutCreateOptions(
amount: (map['amount'] as num).toInt(),
currency: (map['currency'] as String),
description:
map['description'] == null ? null : (map['description'] as String),
destination:
map['destination'] == null ? null : (map['destination'] as String),
expand: map['expand'] == null
? null
: (map['expand'] as List<Object?>)
.map((el) => (el as String))
.toList(),
metadata: map['metadata'] == null
? null
: (map['metadata'] as Map).cast<String, Object?>().map((
key,
value,
) =>
MapEntry(
key,
(value as String),
)),
method: map['method'] == null
? null
: BankAccountAvailablePayoutMethodsItem.fromJson(map['method']),
sourceType: map['source_type'] == null
? null
: PayoutSourceType.fromJson(map['source_type']),
statementDescriptor: map['statement_descriptor'] == null
? null
: (map['statement_descriptor'] as String),
);
}