| Line 65... |
Line 65... |
| 65 |
OrderStatus.RTO_IN_TRANSIT : -5,
|
65 |
OrderStatus.RTO_IN_TRANSIT : -5,
|
| 66 |
OrderStatus.DELIVERY_SUCCESS : 1,
|
66 |
OrderStatus.DELIVERY_SUCCESS : 1,
|
| 67 |
OrderStatus.DOA_CERT_INVALID : -5
|
67 |
OrderStatus.DOA_CERT_INVALID : -5
|
| 68 |
}
|
68 |
}
|
| 69 |
|
69 |
|
| - |
|
70 |
delhi_pincodes = ['110001','110002','110003','110004','110005','110006','110007','110008','110009','110010','110011','110012','110013','110014','110015',\
|
| - |
|
71 |
'110016','110017','110018','110019','110020','110021','110022','110023','110024','110025','110026','110027','110028','110029','110030',\
|
| - |
|
72 |
'110031','110032','110033','110034','110035','110037','110038','110041','110042','110044','110045','110046','110047','110048','110049',\
|
| - |
|
73 |
'110051','110052','110053','110054','110055','110056','110057','110058','110059','110060','110061','110062','110063','110064','110065',\
|
| - |
|
74 |
'110066','110067','110068','110070','110071','110074','110075','110076','110078','110081','110082','110083','110084','110085','110086',\
|
| - |
|
75 |
'110087','110088','110089','110091','110092','110093','110094','110095','110096','110101','110103','110104','110105','110106','110107',\
|
| - |
|
76 |
'110108','110109','110110','110112','110113','110114','110115','110116','110117','110118','110119','110120','110122','110124','110125',\
|
| - |
|
77 |
'110301','110302','110501','110502','110503','110504','110505','110510','110511','110512','110601','110602','110603','110604','110605',\
|
| - |
|
78 |
'110606','110607','110608','110609']
|
| - |
|
79 |
|
| 70 |
def get_new_transaction():
|
80 |
def get_new_transaction():
|
| 71 |
transaction = Transaction()
|
81 |
transaction = Transaction()
|
| 72 |
transaction.createdOn = datetime.datetime.now()
|
82 |
transaction.createdOn = datetime.datetime.now()
|
| 73 |
transaction.status = TransactionStatus.INIT
|
83 |
transaction.status = TransactionStatus.INIT
|
| 74 |
transaction.status_message = "New transaction"
|
84 |
transaction.status_message = "New transaction"
|
| Line 191... |
Line 201... |
| 191 |
|
201 |
|
| 192 |
def change_transaction_status(transaction_id, new_status, description, pickUp, orderType):
|
202 |
def change_transaction_status(transaction_id, new_status, description, pickUp, orderType):
|
| 193 |
transaction = get_transaction(transaction_id)
|
203 |
transaction = get_transaction(transaction_id)
|
| 194 |
transaction.status = new_status
|
204 |
transaction.status = new_status
|
| 195 |
transaction.status_message = description
|
205 |
transaction.status_message = description
|
| - |
|
206 |
## Assign runner in case of delhi pincodes
|
| - |
|
207 |
if transaction.orders[0].pickupStoreId and delhi_pincodes.__contains__(transaction.orders[0].customer_pincode):
|
| - |
|
208 |
pickUp = PickUpType.RUNNER
|
| - |
|
209 |
|
| 196 |
if new_status == TransactionStatus.FAILED:
|
210 |
if new_status == TransactionStatus.FAILED:
|
| 197 |
for order in transaction.orders:
|
211 |
for order in transaction.orders:
|
| 198 |
order.status = OrderStatus.PAYMENT_FAILED
|
212 |
order.status = OrderStatus.PAYMENT_FAILED
|
| 199 |
order.statusDescription = "Payment Failed"
|
213 |
order.statusDescription = "Payment Failed"
|
| 200 |
elif new_status == TransactionStatus.AUTHORIZED or new_status == TransactionStatus.FLAGGED:
|
214 |
elif new_status == TransactionStatus.AUTHORIZED or new_status == TransactionStatus.FLAGGED:
|