| Line 202... |
Line 202... |
| 202 |
def change_transaction_status(transaction_id, new_status, description, pickUp, orderType):
|
202 |
def change_transaction_status(transaction_id, new_status, description, pickUp, orderType):
|
| 203 |
transaction = get_transaction(transaction_id)
|
203 |
transaction = get_transaction(transaction_id)
|
| 204 |
transaction.status = new_status
|
204 |
transaction.status = new_status
|
| 205 |
transaction.status_message = description
|
205 |
transaction.status_message = description
|
| 206 |
## Assign runner in case of delhi pincodes
|
206 |
## Assign runner in case of delhi pincodes
|
| - |
|
207 |
if transaction.orders[0].pickupStoreId:
|
| - |
|
208 |
logistics_client = LogisticsClient().get_client()
|
| 207 |
if transaction.orders[0].pickupStoreId and delhi_pincodes.__contains__(transaction.orders[0].customer_pincode):
|
209 |
store = logistics_client.getPickupStore(transaction.orders[0].pickupStoreId)
|
| - |
|
210 |
if delhi_pincodes.__contains__(store.pin):
|
| 208 |
pickUp = PickUpType.RUNNER
|
211 |
pickUp = PickUpType.RUNNER
|
| 209 |
|
212 |
|
| 210 |
if new_status == TransactionStatus.FAILED:
|
213 |
if new_status == TransactionStatus.FAILED:
|
| 211 |
for order in transaction.orders:
|
214 |
for order in transaction.orders:
|
| 212 |
order.status = OrderStatus.PAYMENT_FAILED
|
215 |
order.status = OrderStatus.PAYMENT_FAILED
|
| 213 |
order.statusDescription = "Payment Failed"
|
216 |
order.statusDescription = "Payment Failed"
|