Examples of MesRuntimeException


Examples of com.mes.sdk.exception.MesRuntimeException

   
    for(Map.Entry<String, String> pair : req.requestTable.entrySet()) {
      try {
        requestString = requestString.concat("&").concat(pair.getKey()).concat("=").concat(URLEncoder.encode(pair.getValue(), "UTF-8"));
      } catch (UnsupportedEncodingException e) {
        throw new MesRuntimeException("Unable to URL Encode the following value: "+pair.getKey() + " / " +pair.getValue());
      }
    }
    return requestString;
  }
View Full Code Here

Examples of com.mes.sdk.exception.MesRuntimeException

          LOG.log(Level.INFO, resp);
      }
    } catch (SocketTimeoutException e) {
      throw new CommunicationException("Request timed out after "+settings.getTimeout()+"ms.");
    } catch (IOException e) {
      throw new MesRuntimeException(e);
    } finally {
      if(connection != null)
        connection.disconnect();
      this.duration = System.currentTimeMillis() - start;
      this.rawResponse = resp;
View Full Code Here

Examples of com.mes.sdk.exception.MesRuntimeException

   
    if(requestTable.containsKey("card_number")) {
      // attempt to sanitize ccnum
     
      if(!Util.CheckCC(requestTable.get("card_number")))
        throw new MesRuntimeException("Card number is invalid");
      if(!requestTable.containsKey("card_exp_date"))
        throw new ValidationException(type+" using \"card_number\" requires \"card_exp_date\".");
    }
    else if(requestTable.containsKey("card_id")) {
      if(!requestTable.containsKey("card_exp_date"))
View Full Code Here

Examples of com.mes.sdk.exception.MesRuntimeException

   
    for(Map.Entry<String, String> pair : req.requestTable.entrySet()) {
      try {
        sb.append("&").append(pair.getKey()).append("=").append(URLEncoder.encode(pair.getValue(), "UTF-8"));
      } catch (UnsupportedEncodingException e) {
        throw new MesRuntimeException("Unable to URL Encode the following value: "+pair.getValue());
      }
    }
   
    // Add each level 3 line items to the request.
    for(int i=0; i<req.lineItems.size(); ++i) {
      LineItemData lineItem = req.lineItems.get(i);
      try {
        sb.append("&").append(lineItem.getFieldName()).append("=");
        sb.append(URLEncoder.encode(lineItem.toString(), "UTF-8"));
      } catch (UnsupportedEncodingException e) {
        throw new MesRuntimeException("Unable to URL Encode the following line item value: "+lineItem.toString());
      }
    }
    if(req.lineItems.size() > 0) {
      sb.append("&").append(LineItemData.lineItemCountFieldName).append("=").append(req.lineItems.size());
    }
View Full Code Here

Examples of com.mes.sdk.exception.MesRuntimeException

    super(null, httpCode, httpText, rawResponse, duration);
  }

  @Override
  public HashMap<String, String> getResponseValues() {
    throw new MesRuntimeException("Response values not supported via Reporting API.");
  }
View Full Code Here

Examples of com.mes.sdk.exception.MesRuntimeException

    throw new MesRuntimeException("Response values not supported via Reporting API.");
  }

  @Override
  public String getResponseValue(String key) {
    throw new MesRuntimeException("Response values not supported via Reporting API.");
  }
View Full Code Here

Examples of com.mes.sdk.exception.MesRuntimeException

            case GATEWAYREQUESTLOG: reportId = "16"; break;
            case ACHSETTLEMENT: reportId = "17"; break;
            case ACHRETURN: reportId = "18"; break;
            case TRIDENTBATCH: reportId = "19"; break;
            default:
                throw new MesRuntimeException("Report type unsupported: "+request.getType());
        }

        requestString.append("&dsReportId=").append(reportId);

        String reportMode = null;
        switch (request.getMode())
        {
            case SUMMARY: reportMode = "0"; break;
            case DETAIL: reportMode = "1"; break;
            default:
                throw new MesRuntimeException("Report mode unsupported: " + request.getType());
        }
        requestString.append("&reportType=").append(reportMode);
       
        for(Map.Entry<String, String> pair : request.requestTable.entrySet()) {
      try {
        requestString = requestString.append("&").append(pair.getKey()).append("=").append(URLEncoder.encode(pair.getValue(), "UTF-8"));
      } catch (UnsupportedEncodingException e) {
        throw new MesRuntimeException("Unable to URL Encode the following value: "+pair.getValue());
      }
    }
        return requestString.toString();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.