接口中的两次请求

来源:互联网 发布:从底层看java中的接口 编辑:程序博客网 时间:2024/06/05 10:41

responseStr.contains("status")&&responseStr.contains("payState")



if(!billId.equals("null")){
    String responseStr_zhifu=getPay(billId);
    System.out.println(responseStr_zhifu);
    JSONObject jsona=new JSONObject(responseStr_zhifu);
    JSONArray jsonarr=jsona.getJSONArray("subErrors");
    JSONObject datatObj=(JSONObject) jsonarr.get(jsonarr.length()-1);
    String code=datatObj.get("code").toString();
    String message=datatObj.get("message").toString();


}

 public static String getPay(String orderid){
       String method="qianmi.elife";
       String format="json";
       String v="1.1";
       SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
       String timestamp  = df.format(new Date());
       String access_token="";
       String appKey="";
       String appSecret="";
       String billId=orderid;
       String sign=shaEncrypt("timestamp"+timestamp+"v"+v+appSecret).toUpperCase();
         
  String supplierServerUrl ="";
  String responseStr="";
  try {
  NameValuePair[] nvp = { 
    new NameValuePair("method", method),
               new NameValuePair("format", format),
               new NameValuePair("v", v),
         ...............................

............................................

....................................正常写后面

0 0
原创粉丝点击