接口中的两次请求

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/anmoyyh/article/details/70224262

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),
         ...............................

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

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

展开阅读全文

没有更多推荐了,返回首页