PaymentIntentCaptureOptions.fromJson constructor
PaymentIntentCaptureOptions.fromJson(
- Object? json
Implementation
factory PaymentIntentCaptureOptions.fromJson(Object? json) {
final map = (json as Map).cast<String, Object?>();
return PaymentIntentCaptureOptions(
amountToCapture: map['amount_to_capture'] == null
? null
: (map['amount_to_capture'] as num).toInt(),
applicationFeeAmount: map['application_fee_amount'] == null
? null
: (map['application_fee_amount'] as num).toInt(),
expand: map['expand'] == null
? null
: (map['expand'] as List<Object?>)
.map((el) => (el as String))
.toList(),
finalCapture:
map['final_capture'] == null ? null : (map['final_capture'] as bool),
metadata: map['metadata'] == null
? null
: (map['metadata'] as Map).cast<String, Object?>().map((
key,
value,
) =>
MapEntry(
key,
(value as String),
)),
statementDescriptor: map['statement_descriptor'] == null
? null
: (map['statement_descriptor'] as String),
statementDescriptorSuffix: map['statement_descriptor_suffix'] == null
? null
: (map['statement_descriptor_suffix'] as String),
transferData: map['transfer_data'] == null
? null
: PaymentFlowsAmountDetailsResourceTip.fromJson(map['transfer_data']),
);
}