Subversion Repositories SmartDukaan

Rev

Rev 13547 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 13547 Rev 13548
Line 98... Line 98...
98
			if (0 == ((Integer)postMap.get("status")).intValue()) {
98
			if (0 == ((Integer)postMap.get("status")).intValue()) {
99
				log.info("Some error occurred at Payu");
99
				log.info("Some error occurred at Payu");
100
				resultMap.put(ERR_CODE, Errors.CAPTURE_FAILURE.code);
100
				resultMap.put(ERR_CODE, Errors.CAPTURE_FAILURE.code);
101
				resultMap.put(ERROR, (String)postMap.get("msg"));
101
				resultMap.put(ERROR, (String)postMap.get("msg"));
102
			} else if (1 == ((Integer)postMap.get("status")).intValue()){
102
			} else if (1 == ((Integer)postMap.get("status")).intValue()){
-
 
103
				System.out.println("in io block"); 
103
				if(postMap.get("bank_ref_num")!=null){ 
104
				if(!JSONObject.NULL.equals(postMap.get("bank_ref_num"))){ 
104
					resultMap.put(REF_NO, (String) postMap.get("bank_ref_num"));
105
					resultMap.put(REF_NO, (String) postMap.get("bank_ref_num"));
105
				}
106
				}
-
 
107
				System.out.println("after bankrefnum"); 
106
				if(postMap.get("txn_update_id")!= null) {
108
				if(postMap.get("txn_update_id")!= null) {
107
					resultMap.put("txn_update_id", (String)postMap.get("txn_update_id"));
109
					resultMap.put("txn_update_id", (String)postMap.get("txn_update_id"));
108
				}
110
				}
-
 
111
				System.out.println("after txn update"); 
109
				if(postMap.get("request_id")!=null){
112
				if(postMap.get("request_id")!=null){
110
					resultMap.put("txn_update_id", (String)postMap.get("request_id"));
113
					resultMap.put("txn_update_id", (String)postMap.get("request_id"));
111
				}
114
				}
-
 
115
				System.out.println("after request_id"); 
112
				resultMap.put("mihpayid", ((Integer)postMap.get("mihpayid")).toString());
116
				resultMap.put("mihpayid", ((Integer)postMap.get("mihpayid")).toString());
-
 
117
				System.out.println("after mihpayid"); 
113
				resultMap.put("msg", (String)postMap.get("msg"));
118
				resultMap.put("msg", (String)postMap.get("msg"));
114
			}
119
			}
115
		} catch (JSONException e) {
120
		} catch (JSONException e) {
116
			log.error("Could not Parse json");
121
			log.error("Could not Parse json");
117
			resultMap.put(ERR_CODE, Errors.CAPTURE_FAILURE.code);
122
			resultMap.put(ERR_CODE, Errors.CAPTURE_FAILURE.code);
Line 277... Line 282...
277
		Map<String, Object> postMap = (Map<String, Object>) gson.fromJson(
282
		Map<String, Object> postMap = (Map<String, Object>) gson.fromJson(
278
				jsonText, Object.class);
283
				jsonText, Object.class);
279
		System.out.println(postMap);
284
		System.out.println(postMap);
280
		System.out.println(0 == ((Integer)postMap.get("amit")).intValue());*/
285
		System.out.println(0 == ((Integer)postMap.get("amit")).intValue());*/
281
		try {
286
		try {
-
 
287
			String postResponse = "{\"status\":1,\"msg\":\"Refund Request Queued\",\"request_id\":\"172046358\",\"bank_ref_num\":null,\"mihpayid\":251494242,\"error_code\":102}";
282
			JSONObject jo = new JSONObject(jsonText);
288
			JSONObject postMap = new JSONObject(postResponse);
-
 
289
			String a = "";
-
 
290
			log.info("postMap.get(\"status\")=======" + postMap.get("status"));
-
 
291
			if (0 == ((Integer)postMap.get("status")).intValue()) {
-
 
292
				log.info("Some error occurred at Payu");
-
 
293
				a= (String)postMap.get("msg");
-
 
294
			} else if (1 == ((Integer)postMap.get("status")).intValue()){
283
			System.out.println(jo);
295
				System.out.println("in io block"); 
284
			System.out.println(0 == ((Integer)jo.get("amit")).intValue());
296
				System.out.println(postMap.get("bank_ref_num").getClass());
-
 
297
				if(postMap.get("bank_ref_num")!=null){ 
-
 
298
					a = (String) postMap.get("bank_ref_num");
-
 
299
				}
-
 
300
				System.out.println("after bankrefnum"); 
-
 
301
				if(postMap.get("txn_update_id")!= null) {
-
 
302
					a = (String)postMap.get("txn_update_id");
-
 
303
				}
-
 
304
				System.out.println("after txn update"); 
-
 
305
				if(JSONObject.NULL.equals(postMap.get("request_id"))){
-
 
306
					a = (String)postMap.get("request_id");
-
 
307
				}
285
			System.out.println((String)jo.get("Raka"));
308
				System.out.println("after request_id"); 
-
 
309
				((Integer)postMap.get("mihpayid")).toString();
-
 
310
				System.out.println("after mihpayid"); 
-
 
311
				a = (String)postMap.get("msg");
-
 
312
			}
286
		} catch (JSONException e) {
313
		} catch (JSONException e) {
287
			// TODO Auto-generated catch block
-
 
288
			e.printStackTrace();
314
			System.out.println("in catch");
289
		}
315
		}
290
	}
316
	}
291
}
317
}