| Line 122... |
Line 122... |
| 122 |
update_recharge_order_status(order.id, RechargeOrderStatus.RECHARGE_FAILED)
|
122 |
update_recharge_order_status(order.id, RechargeOrderStatus.RECHARGE_FAILED)
|
| 123 |
except:
|
123 |
except:
|
| 124 |
print "Do Nothing"
|
124 |
print "Do Nothing"
|
| 125 |
|
125 |
|
| 126 |
## For store transactions
|
126 |
## For store transactions
|
| 127 |
rorders = RechargeTransaction.query.filter_by(status = RechargeOrderStatus.RECHARGE_UNKNOWN).all()
|
127 |
rorders = RechargeTransaction.query.filter(RechargeTransaction.status.in_([RechargeOrderStatus.RECHARGE_UNKNOWN, RechargeOrderStatus.INIT])).all()
|
| 128 |
for order in rorders:
|
128 |
for order in rorders:
|
| 129 |
try:
|
129 |
try:
|
| 130 |
if order.transactionTime + datetime.timedelta(minutes=10) < datetime.datetime.now():
|
130 |
if order.transactionTime + datetime.timedelta(minutes=10) < datetime.datetime.now():
|
| 131 |
status, description = checkTransactionStatus('', str(order.id))
|
131 |
status, description = checkTransactionStatus('', str(order.id))
|
| 132 |
print status, description
|
132 |
print status, description
|
| 133 |
if status:
|
133 |
if status:
|
| 134 |
update_recharge_transaction_status(order.id, RechargeOrderStatus.RECHARGE_SUCCESSFUL)
|
134 |
update_recharge_transaction_status(order.id, RechargeOrderStatus.RECHARGE_SUCCESSFUL)
|
| - |
|
135 |
elif order.status == RechargeOrderStatus.INIT:
|
| - |
|
136 |
update_recharge_transaction_status(order.id, RechargeOrderStatus.RECHARGE_FAILED)
|
| 135 |
else:
|
137 |
else:
|
| 136 |
update_recharge_transaction_status(order.id, RechargeOrderStatus.RECHARGE_FAILED_REFUNDED)
|
138 |
update_recharge_transaction_status(order.id, RechargeOrderStatus.RECHARGE_FAILED_REFUNDED)
|
| 137 |
except:
|
139 |
except:
|
| 138 |
print "Do Nothing"
|
140 |
print "Do Nothing"
|
| 139 |
|
141 |
|