Subversion Repositories SmartDukaan

Rev

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

Rev 12833 Rev 12834
Line 62... Line 62...
62
    }
62
    }
63
 
63
 
64
 
64
 
65
    public boolean updatePrice(String skuAtFlipkart, String sellingPrice) throws ClientProtocolException, IOException, JSONException{
65
    public boolean updatePrice(String skuAtFlipkart, String sellingPrice) throws ClientProtocolException, IOException, JSONException{
66
        
66
        
67
        if (!Boolean.valueOf(UPDATE_PRICE_ON_FK)){
67
        if (Boolean.valueOf(UPDATE_PRICE_ON_FK)){
68
            return true;
68
            return true;
69
        }
69
        }
70
 
70
 
71
        HttpPost post = new HttpPost("https://seller.flipkart.com/login");
71
        HttpPost post = new HttpPost("https://seller.flipkart.com/login");
72
        BufferedReader rd= null;
72
        BufferedReader rd= null;
Line 144... Line 144...
144
        for (int i = 0, size = jsonArray.length(); i < size; i++){
144
        for (int i = 0, size = jsonArray.length(); i < size; i++){
145
            JSONObject x = jsonArray.getJSONObject(i);
145
            JSONObject x = jsonArray.getJSONObject(i);
146
            listingPrice = x.get("listingPrice").toString();
146
            listingPrice = x.get("listingPrice").toString();
147
        }
147
        }
148
        logger.info("New listing price "+listingPrice);
148
        logger.info("New listing price "+listingPrice);
149
        if (Double.valueOf(sellingPrice)==Double.valueOf(listingPrice)){
149
        System.out.println(Double.valueOf(sellingPrice));
150
            logger.info("Returning true");
150
        System.out.println(Double.valueOf(listingPrice));
-
 
151
        if (Double.valueOf(sellingPrice).equals(Double.valueOf(listingPrice))){
151
            return true;
152
            return true;
152
        }
153
        }
153
        return false;
154
        return false;
154
    }
155
    }
155
 
156
 
Line 166... Line 167...
166
           //return "{\"sellerId\":\"m2z93iskuj81qiid\",\"bulkListingRequest\":{\"listings\":[{\"listingId\":\"LSTACCDSN8FSJTTYPCQZWWGJL\",\"attributeValues\":{\"selling_price\":\"4901\"},\"listingValidations\":{\"PRICE_ERROR_CHECK\":\"enable\"}}]},\"_csrf\":\"wuru84MMNRMhRCWtlhydVdN9\"}";
167
           //return "{\"sellerId\":\"m2z93iskuj81qiid\",\"bulkListingRequest\":{\"listings\":[{\"listingId\":\"LSTACCDSN8FSJTTYPCQZWWGJL\",\"attributeValues\":{\"selling_price\":\"4901\"},\"listingValidations\":{\"PRICE_ERROR_CHECK\":\"enable\"}}]},\"_csrf\":\"wuru84MMNRMhRCWtlhydVdN9\"}";
167
    }
168
    }
168
 
169
 
169
    public static void main(String[] args) throws ClientProtocolException, IOException, JSONException{
170
    public static void main(String[] args) throws ClientProtocolException, IOException, JSONException{
170
        FlipkartPricingPannel fkPricing = new FlipkartPricingPannel();
171
        FlipkartPricingPannel fkPricing = new FlipkartPricingPannel();
171
        System.out.println(fkPricing.updatePrice("10792","1085"));
172
        System.out.println(fkPricing.updatePrice("169","629"));
172
    }
173
    }
173
 
174
 
174
 
175
 
175
 
176
 
176
}
177
}
177
178