/// result : {"code":"0","description":"Successfully completed","hostResponse":{"code":"0","description":"Successfully completed"}}
/// transaction : {"terminalId":"123321","operationDay":"4","transactionNumber":"69","instrumentSpecificData":{"authorizationCode":"000000","rrn":"1234567890","cardholderName":"IVAN IVANOV","maskedPan":"123456******7890"}}

class HalykResponse {
  ResultBean? result;
  TransactionBean? transaction;

  HalykResponse({this.result, this.transaction});

  static HalykResponse? fromMap(Map<String, dynamic>? map) {
    if (map == null) return null;
    HalykResponse halykResponseBean = HalykResponse();
    halykResponseBean.result = ResultBean.fromMap(map['result']);
    halykResponseBean.transaction = TransactionBean.fromMap(map['transaction']);
    return halykResponseBean;
  }

  Map toJson() =>
      {
        "result": result,
        "transaction": transaction,
      };
}

/// terminalId : "123321"
/// operationDay : "4"
/// transactionNumber : "69"
/// instrumentSpecificData : {"authorizationCode":"000000","rrn":"1234567890","cardholderName":"IVAN IVANOV","maskedPan":"123456******7890"}

class TransactionBean {
  int? terminalId;
  int? operationDay;
  int? transactionNumber;
  InstrumentSpecificDataBean? instrumentSpecificData;

  static TransactionBean? fromMap(Map<String, dynamic>? map) {
    if (map == null) return null;
    TransactionBean transactionBean = TransactionBean();
    transactionBean.terminalId = map['terminalId'];
    transactionBean.operationDay = map['operationDay'];
    transactionBean.transactionNumber = map['transactionNumber'];
    transactionBean.instrumentSpecificData = InstrumentSpecificDataBean.fromMap(map['instrumentSpecificData']);
    return transactionBean;
  }

  Map toJson() =>
      {
        "terminalId": terminalId,
        "operationDay": operationDay,
        "transactionNumber": transactionNumber,
        "instrumentSpecificData": instrumentSpecificData,
      };
}

/// authorizationCode : "000000"
/// rrn : "1234567890"
/// cardholderName : "IVAN IVANOV"
/// maskedPan : "123456******7890"

class InstrumentSpecificDataBean {
  String? authorizationCode;
  String? rrn;
  String? cardholderName;
  String? maskedPan;

  static InstrumentSpecificDataBean? fromMap(Map<String, dynamic>? map) {
    if (map == null) return null;
    InstrumentSpecificDataBean instrumentSpecificDataBean = InstrumentSpecificDataBean();
    instrumentSpecificDataBean.authorizationCode = map['authorizationCode'];
    instrumentSpecificDataBean.rrn = map['rrn'];
    instrumentSpecificDataBean.cardholderName = map['cardholderName'];
    instrumentSpecificDataBean.maskedPan = map['maskedPan'];
    return instrumentSpecificDataBean;
  }

  Map toJson() =>
      {
        "authorizationCode": authorizationCode,
        "rrn": rrn,
        "cardholderName": cardholderName,
        "maskedPan": maskedPan,
      };
}

/// code : "0"
/// description : "Successfully completed"
/// hostResponse : {"code":"0","description":"Successfully completed"}

class ResultBean {
  int? code;
  String? description;
  HostResponseBean? hostResponse;
  ErrorResponseBean? errorData;

  ResultBean({this.code, this.description});

  static ResultBean? fromMap(Map<String, dynamic>? map) {
    if (map == null) return null;
    ResultBean resultBean = ResultBean();
    resultBean.code = map['code'];
    resultBean.description = map['description'];
    resultBean.hostResponse = HostResponseBean.fromMap(map['hostResponse']);
    resultBean.errorData = ErrorResponseBean.fromMap(map['errorData']);
    return resultBean;
  }

  Map toJson() =>
      {
        "code": code,
        "description": description,
        "hostResponse": hostResponse,
        "errorData": errorData,
      };
}

/// code : "0"
/// description : "Successfully completed"

class HostResponseBean {
  String? code;
  String? description;

  static HostResponseBean? fromMap(Map<String, dynamic>? map) {
    if (map == null) return null;
    HostResponseBean hostResponseBean = HostResponseBean();
    hostResponseBean.code = map['code'];
    hostResponseBean.description = map['description'];
    return hostResponseBean;
  }

  Map toJson() =>
      {
        "code": code,
        "description": description,
      };
}

class ErrorResponseBean {
  int? code;
  String? description;

  static ErrorResponseBean? fromMap(Map<String, dynamic>? map) {
    if (map == null) return null;
    ErrorResponseBean errorResponseBean  = ErrorResponseBean();
    errorResponseBean.code = map['code'];
    errorResponseBean.description = map['description'];
    return errorResponseBean;
  }

  Map toJson() =>
      {
        "code": code,
        "description": description,
      };
}