ChargeCaptureOptions.fromJson constructor

ChargeCaptureOptions.fromJson(
  1. Object? json
)

Implementation

factory ChargeCaptureOptions.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return ChargeCaptureOptions(
    amount: map['amount'] == null ? null : (map['amount'] as num).toInt(),
    applicationFee: map['application_fee'] == null
        ? null
        : (map['application_fee'] 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(),
    receiptEmail: map['receipt_email'] == null
        ? null
        : (map['receipt_email'] 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']),
    transferGroup: map['transfer_group'] == null
        ? null
        : (map['transfer_group'] as String),
  );
}