Subversion Repositories SmartDukaan

Rev

Rev 18573 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 18573 Rev 20163
Line 115... Line 115...
115
        #Expected is json
115
        #Expected is json
116
        rawHtml = "".join(["{", find_between(rawHtml,">{", "}</pre>"), "}"])
116
        rawHtml = "".join(["{", find_between(rawHtml,">{", "}</pre>"), "}"])
117
        if rawHtml != "": 
117
        if rawHtml != "": 
118
            try:
118
            try:
119
                resp = {}
119
                resp = {}
-
 
120
                if rawHtml == '{}':
-
 
121
#                     print "Rawhtml" , rawHtml
-
 
122
                    resp['result'] = 'ORDER_NOT_CREATED_KNOWN'
-
 
123
                    return resp
120
                #orderSuccessUrl = "https://paytm.com/shop/orderdetail/1155961075?actions=1&channel=web&version=2"
124
                #orderSuccessUrl = "https://paytm.com/shop/orderdetail/1155961075?actions=1&channel=web&version=2"
121
                ordermap = json.loads(rawHtml).get("order")
125
                ordermap = json.loads(rawHtml).get("order")
122
                if not ordermap.get("need_shipping"):
126
                if not ordermap.get("need_shipping"):
123
                    resp['result'] = 'RECHARGE_ORDER_IGNORED'
127
                    resp['result'] = 'RECHARGE_ORDER_IGNORED'
124
                    return resp
128
                    return resp
Line 230... Line 234...
230
    tzDate = tzDate + timedelta(0,19800)
234
    tzDate = tzDate + timedelta(0,19800)
231
    return tzDate
235
    return tzDate
232
 
236
 
233
def main():
237
def main():
234
    store = getStore(6)
238
    store = getStore(6)
235
    print store.parseOrderRawHtml(2121113, '1', 7304, readSSh("/home/amit/7304.html"), 'https://paytm.com/shop/summary/1236949005')
239
    print store.parseOrderRawHtml(140284, '796881_SHA61467477927', 26050, readSSh("/home/manish/paytm.html"), 'https://paytm.com/shop/summary/1857113078')
236
    #store.scrapeStoreOrders()
240
    #store.scrapeStoreOrders()
237
    #store.trackOrdersForUser(2, "https://paytm.com/shop/orderdetail/1168545614?actions=1&channel=web&version=2", readSSh("/home/amit/p.html"))
241
    #store.trackOrdersForUser(2, "https://paytm.com/shop/orderdetail/1168545614?actions=1&channel=web&version=2", readSSh("/home/amit/p.html"))
238
    #print store.getTrackingUrls(14)
242
    #print store.getTrackingUrls(14)
239
    
243
    
240
if __name__ == '__main__':
244
if __name__ == '__main__':