PaymentIntentIncrementAuthorizationOptions.fromJson constructor

PaymentIntentIncrementAuthorizationOptions.fromJson(
  1. Object? json
)

Implementation

factory PaymentIntentIncrementAuthorizationOptions.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return PaymentIntentIncrementAuthorizationOptions(
    amount: (map['amount'] as num).toInt(),
    applicationFeeAmount: map['application_fee_amount'] == null
        ? null
        : (map['application_fee_amount'] as num).toInt(),
    description:
        map['description'] == null ? null : (map['description'] 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),
                )),
    statementDescriptor: map['statement_descriptor'] == null
        ? null
        : (map['statement_descriptor'] as String),
    transferData: map['transfer_data'] == null
        ? null
        : PaymentFlowsAmountDetailsResourceTip.fromJson(map['transfer_data']),
  );
}