IssuingAuthorizationCaptureOptions.fromJson constructor

IssuingAuthorizationCaptureOptions.fromJson(
  1. Object? json
)

Implementation

factory IssuingAuthorizationCaptureOptions.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return IssuingAuthorizationCaptureOptions(
    captureAmount: map['capture_amount'] == null
        ? null
        : (map['capture_amount'] as num).toInt(),
    closeAuthorization: map['close_authorization'] == null
        ? null
        : (map['close_authorization'] as bool),
    expand: map['expand'] == null
        ? null
        : (map['expand'] as List<Object?>)
            .map((el) => (el as String))
            .toList(),
    purchaseDetails: map['purchase_details'] == null
        ? null
        : AuthorizationPurchaseDetails.fromJson(map['purchase_details']),
  );
}