Attempt.fromJson constructor

Attempt.fromJson(
  1. Map<String, Object?> json
)

Implementation

factory Attempt.fromJson(Map<String, Object?> json) => Attempt(
      paymentMethodType: json["payment_method_type"] == null
          ? null
          : json["payment_method_type"] as String,
      paymentMethodId: json["payment_method_id"] == null
          ? null
          : json["payment_method_id"] as String,
      reference:
          json["reference"] == null ? null : json["reference"] as String,
      error: json["error"] == null
          ? null
          : AttemptError.fromJson(
              (json["error"] as Map).cast<String, Object?>(),
            ),
      status: AttemptStatus.fromJson(json["status"]),
      initiatedAt: decodeDateTime(json["initiated_at"]),
      succeededAt: json["succeeded_at"] == null
          ? null
          : decodeDateTime(json["succeeded_at"]),
    );