Subversion Repositories SmartDukaan

Rev

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

Rev 32777 Rev 32850
Line 263... Line 263...
263
        LOGGER.info("response  - {}", response);
263
        LOGGER.info("response  - {}", response);
264
 
264
 
265
        JSONObject jsonObject = new JSONObject(response);
265
        JSONObject jsonObject = new JSONObject(response);
266
 
266
 
267
        JSONObject whatsappResponse = (JSONObject) jsonObject.get("response");
267
        JSONObject whatsappResponse = (JSONObject) jsonObject.get("response");
-
 
268
        if(whatsappResponse.getString("status").equals("error")) {
-
 
269
            LOGGER.error("Invalid Whatsapp message, Reason - {}",whatsappResponse.getString("details"));
-
 
270
            return;
268
 
271
        }
269
        String externalId = whatsappResponse.getString("id");
272
        String externalId = whatsappResponse.getString("id");
270
        String phone = whatsappResponse.getString("phone");
273
        String phone = whatsappResponse.getString("phone");
271
 
274
 
272
        WhatsappMessage whatsappMessage = new WhatsappMessage();
275
        WhatsappMessage whatsappMessage = new WhatsappMessage();
273
        whatsappMessage.setCreatedTimestamp(LocalDateTime.now());
276
        whatsappMessage.setCreatedTimestamp(LocalDateTime.now());