message: Fixed Libnullpay integration tests
diff: @@ -23,11 +23,26 @@ pub fn parse_req_id_from_request(request: &str) -> Result<u64, ErrorCode> {
  pub fn get_response(response: &str) -> Result<String, ErrorCode> {
  let val = str_to_val(response)?;
  - let object = val_to_obj(&val)?;
  - let result = get_val_from_obj(object, "result")?;
  - let result_obj = val_to_obj(result)?;
  - let req_id = get_val_from_obj(result_obj, "reqId")?;
  - let req_id = val_to_u64(req_id)?;
  +
  + let req_id = match val["result"]["ver"].as_str() {
  + Some("1") =>
  + val.get("result")
  + .and_then(|result| result.as_object())
  + .and_then(|result| result.get("txn"))
  + .and_then(|txn| txn.as_object())
  + .and_then(|txn| txn.get("metadata"))
  + .and_then(|metadata| metadata.as_object())
  + .and_then(|metadata| metadata.get("reqId"))
  + .and_then(|req_id| req_id.as_i64()),
  + None =>
  + val.get("result")
  + .and_then(|result| result.as_object())
  + .and_then(|result| result.get("reqId"))
  + .and_then(|req_id| req_id.as_i64()),
  + _ => return Err(ErrorCode::CommonInvalidState)
  + };
  +
  + let req_id = req_id.ok_or(ErrorCode::CommonInvalidStructure)?;
  let mut responses = RESPONSES.lock().unwrap();
  match responses.remove(req_id.to_string().as_str()) {
  