| 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 |
log.info("postMap.containsKey(\"bank_ref_num\")========" + postMap.has("bank_ref_num"));
|
103 |
if(postMap.get("bank_ref_num")!=null){
|
| 104 |
resultMap.put(REF_NO, (String) postMap.get("bank_ref_num"));
|
104 |
resultMap.put(REF_NO, (String) postMap.get("bank_ref_num"));
|
| - |
|
105 |
}
|
| 105 |
if(postMap.get("txn_update_id")!= null) {
|
106 |
if(postMap.get("txn_update_id")!= null) {
|
| 106 |
resultMap.put("txn_update_id", (String)postMap.get("txn_update_id"));
|
107 |
resultMap.put("txn_update_id", (String)postMap.get("txn_update_id"));
|
| 107 |
}
|
108 |
}
|
| 108 |
if(postMap.get("request_id")!=null){
|
109 |
if(postMap.get("request_id")!=null){
|
| 109 |
resultMap.put("txn_update_id", (String)postMap.get("txn_update_id"));
|
110 |
resultMap.put("txn_update_id", (String)postMap.get("txn_update_id"));
|
| Line 263... |
Line 264... |
| 263 |
return map;
|
264 |
return map;
|
| 264 |
}
|
265 |
}
|
| 265 |
}
|
266 |
}
|
| 266 |
|
267 |
|
| 267 |
public static void main (String arg[]){
|
268 |
public static void main (String arg[]){
|
| 268 |
String jsonText = "{\"amit\":0, \"babu\":{\"a\":\"Awesome\"}}";
|
269 |
String jsonText = "{\"amit\":0, \"babu\":{\"a\":null}, \"Raka\": null}";
|
| 269 |
/* System.out.println(jsonText);
|
270 |
/* System.out.println(jsonText);
|
| 270 |
GsonBuilder gsonBuilder = new GsonBuilder();
|
271 |
GsonBuilder gsonBuilder = new GsonBuilder();
|
| 271 |
gsonBuilder
|
272 |
gsonBuilder
|
| 272 |
.registerTypeAdapter(Object.class, new NaturalDeserializer());
|
273 |
.registerTypeAdapter(Object.class, new NaturalDeserializer());
|
| 273 |
Gson gson = gsonBuilder.create();
|
274 |
Gson gson = gsonBuilder.create();
|
| Line 279... |
Line 280... |
| 279 |
System.out.println(0 == ((Integer)postMap.get("amit")).intValue());*/
|
280 |
System.out.println(0 == ((Integer)postMap.get("amit")).intValue());*/
|
| 280 |
try {
|
281 |
try {
|
| 281 |
JSONObject jo = new JSONObject(jsonText);
|
282 |
JSONObject jo = new JSONObject(jsonText);
|
| 282 |
System.out.println(jo);
|
283 |
System.out.println(jo);
|
| 283 |
System.out.println(0 == ((Integer)jo.get("amit")).intValue());
|
284 |
System.out.println(0 == ((Integer)jo.get("amit")).intValue());
|
| - |
|
285 |
System.out.println((String)jo.get("Raka"));
|
| 284 |
} catch (JSONException e) {
|
286 |
} catch (JSONException e) {
|
| 285 |
// TODO Auto-generated catch block
|
287 |
// TODO Auto-generated catch block
|
| 286 |
e.printStackTrace();
|
288 |
e.printStackTrace();
|
| 287 |
}
|
289 |
}
|
| 288 |
}
|
290 |
}
|