| Line 15... |
Line 15... |
| 15 |
ORDER_REDIRECT_URL = 'https://www.amazon.in/gp/css/summary/edit.html?orderID=%s'
|
15 |
ORDER_REDIRECT_URL = 'https://www.amazon.in/gp/css/summary/edit.html?orderID=%s'
|
| 16 |
ORDER_SUCCESS_URL = 'https://www.amazon.in/gp/buy/spc/handlers/static-submit-decoupled.html'
|
16 |
ORDER_SUCCESS_URL = 'https://www.amazon.in/gp/buy/spc/handlers/static-submit-decoupled.html'
|
| 17 |
THANKYOU_URL = 'https://www.amazon.in/gp/buy/thankyou/handlers/display.html'
|
17 |
THANKYOU_URL = 'https://www.amazon.in/gp/buy/thankyou/handlers/display.html'
|
| 18 |
class Store(MStore):
|
18 |
class Store(MStore):
|
| 19 |
|
19 |
|
| 20 |
orderStatusRegexMap = { MStore.ORDER_PLACED : ['Ordered from', 'Not Yet Dispatched','Dispatching Now', 'Preparing for Dispatch'],
|
20 |
orderStatusRegexMap = { MStore.ORDER_PLACED : ['ordered from', 'not yet dispatched','dispatching now', 'preparing for dispatch'],
|
| 21 |
MStore.ORDER_SHIPPED : ['Dispatched on','Dispatched', 'On the way', 'Out for delivery'],
|
21 |
MStore.ORDER_SHIPPED : ['dispatched on','dispatched', 'on the way', 'out for delivery'],
|
| 22 |
MStore.ORDER_CANCELLED : ['Return complete', 'Refunded', 'Cancelled'],
|
22 |
MStore.ORDER_CANCELLED : ['return complete', 'refunded', 'cancelled'],
|
| 23 |
MStore.ORDER_DELIVERED : ['Delivered']
|
23 |
MStore.ORDER_DELIVERED : ['delivered']
|
| 24 |
}
|
24 |
}
|
| 25 |
|
25 |
|
| 26 |
def __init__(self,store_id):
|
26 |
def __init__(self,store_id):
|
| 27 |
super(Store, self).__init__(store_id)
|
27 |
super(Store, self).__init__(store_id)
|
| 28 |
|
28 |
|
| Line 206... |
Line 206... |
| 206 |
traceback.print_exc()
|
206 |
traceback.print_exc()
|
| 207 |
return 'PARSED_FAILED'
|
207 |
return 'PARSED_FAILED'
|
| 208 |
|
208 |
|
| 209 |
def _getStatusFromDetailedStatus(self, detailedStatus):
|
209 |
def _getStatusFromDetailedStatus(self, detailedStatus):
|
| 210 |
for key, value in self.orderStatusRegexMap.iteritems():
|
210 |
for key, value in self.orderStatusRegexMap.iteritems():
|
| 211 |
if detailedStatus in value:
|
211 |
if detailedStatus.lower() in value:
|
| 212 |
return key
|
212 |
return key
|
| 213 |
|
213 |
|
| 214 |
print "Detailed Status need to be mapped"
|
214 |
print "Detailed Status need to be mapped"
|
| 215 |
raise ParseException("_getStatusFromDetailedStatus", "Found new order status" + detailedStatus)
|
215 |
raise ParseException("_getStatusFromDetailedStatus", "Found new order status" + detailedStatus)
|
| 216 |
|
216 |
|