MethodsPayment.fromJson constructor

MethodsPayment.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory MethodsPayment.fromJson(Map<String, dynamic> json) => MethodsPayment(
      id: json["id"],
      name: json["name"],
      paymentTypeId: json["payment_type_id"],
      status: json["status"],
      image: json["thumbnail"],
      maxAllowedAmount: json["max_allowed_amount"],
      accreditationTime: json["accreditation_time"],
      cardNumberLength: json["settings"].length > 0
          ? json["settings"][0]["card_number"]["length"]
          : 0,
      installmentsPattern: json["settings"].length > 0
          ? json["settings"][0]["bin"]["installments_pattern"]
          : "",
      exclusionPattern: json["settings"].length > 0
          ? json["settings"][0]["bin"]["exclusion_pattern"]
          : "",
      securityCodeLength: json["settings"].length > 0
          ? json["settings"][0]["security_code"]["length"]
          : 1,
    );