| Line 109... |
Line 109... |
| 109 |
|
109 |
|
| 110 |
|
110 |
|
| 111 |
logging.basicConfig(level=logging.DEBUG)
|
111 |
logging.basicConfig(level=logging.DEBUG)
|
| 112 |
|
112 |
|
| 113 |
sourceId = int(ConfigClient().get_property("sourceid"))
|
113 |
sourceId = int(ConfigClient().get_property("sourceid"))
|
| - |
|
114 |
capitalFloatPayMethod = 456789
|
| 114 |
SaholicHelpEmailId = "Saholic <help@saholic.com>"
|
115 |
SaholicHelpEmailId = "Saholic <help@saholic.com>"
|
| 115 |
mail_user = 'cnc.center@shop2020.in'
|
116 |
mail_user = 'cnc.center@shop2020.in'
|
| 116 |
mail_password = '5h0p2o2o'
|
117 |
mail_password = '5h0p2o2o'
|
| 117 |
help_user = 'help@shop2020.in'
|
118 |
help_user = 'help@shop2020.in'
|
| 118 |
help_password = '5h0p2o2o'
|
119 |
help_password = '5h0p2o2o'
|
| Line 261... |
Line 262... |
| 261 |
transaction.coupon_code = t_transaction.coupon_code
|
262 |
transaction.coupon_code = t_transaction.coupon_code
|
| 262 |
transaction.session_source = t_transaction.sessionSource
|
263 |
transaction.session_source = t_transaction.sessionSource
|
| 263 |
transaction.session_start_time = to_py_date(t_transaction.sessionStartTime)
|
264 |
transaction.session_start_time = to_py_date(t_transaction.sessionStartTime)
|
| 264 |
transaction.first_source = t_transaction.firstSource
|
265 |
transaction.first_source = t_transaction.firstSource
|
| 265 |
transaction.first_source_start_time = to_py_date(t_transaction.firstSourceTime)
|
266 |
transaction.first_source_start_time = to_py_date(t_transaction.firstSourceTime)
|
| - |
|
267 |
transaction.payment_option = t_transaction.payment_option
|
| 266 |
if t_transaction.totalShippingCost:
|
268 |
if t_transaction.totalShippingCost:
|
| 267 |
transaction.totalShippingCost = t_transaction.totalShippingCost
|
269 |
transaction.totalShippingCost = t_transaction.totalShippingCost
|
| 268 |
if t_transaction.totalCodCharges:
|
270 |
if t_transaction.totalCodCharges:
|
| 269 |
transaction.totalCodCharges = t_transaction.totalCodCharges
|
271 |
transaction.totalCodCharges = t_transaction.totalCodCharges
|
| 270 |
|
272 |
|
| Line 408... |
Line 410... |
| 408 |
if new_status == TransactionStatus.FAILED:
|
410 |
if new_status == TransactionStatus.FAILED:
|
| 409 |
for order in transaction.orders:
|
411 |
for order in transaction.orders:
|
| 410 |
order.status = OrderStatus.PAYMENT_FAILED
|
412 |
order.status = OrderStatus.PAYMENT_FAILED
|
| 411 |
order.statusDescription = "Payment Failed"
|
413 |
order.statusDescription = "Payment Failed"
|
| 412 |
elif new_status == TransactionStatus.AUTHORIZED or new_status == TransactionStatus.FLAGGED:
|
414 |
elif new_status == TransactionStatus.AUTHORIZED or new_status == TransactionStatus.FLAGGED:
|
| - |
|
415 |
if transaction.payment_option == capitalFloatPayMethod:
|
| - |
|
416 |
pass
|
| - |
|
417 |
|
| 413 |
for order in transaction.orders:
|
418 |
for order in transaction.orders:
|
| 414 |
if new_status == TransactionStatus.AUTHORIZED:
|
419 |
if new_status == TransactionStatus.AUTHORIZED:
|
| 415 |
order.status = OrderStatus.SUBMITTED_FOR_PROCESSING
|
420 |
order.status = OrderStatus.SUBMITTED_FOR_PROCESSING
|
| 416 |
order.statusDescription = "Submitted to warehouse"
|
421 |
order.statusDescription = "Submitted to warehouse"
|
| 417 |
elif new_status == TransactionStatus.FLAGGED:
|
422 |
elif new_status == TransactionStatus.FLAGGED:
|
| Line 8817... |
Line 8822... |
| 8817 |
|
8822 |
|
| 8818 |
except Exception as e:
|
8823 |
except Exception as e:
|
| 8819 |
print e
|
8824 |
print e
|
| 8820 |
|
8825 |
|
| 8821 |
return new_order
|
8826 |
return new_order
|
| - |
|
8827 |
|
| - |
|
8828 |
def __verify_order(order):
|
| - |
|
8829 |
logging.info("Verifying order no: " + str(order.id))
|
| - |
|
8830 |
if order.status == OrderStatus.COD_VERIFICATION_PENDING:
|
| - |
|
8831 |
order.status = OrderStatus.SUBMITTED_FOR_PROCESSING
|
| - |
|
8832 |
order.statusDescription = "Submitted for processing"
|
| - |
|
8833 |
order.verification_timestamp = datetime.datetime.now()
|
| - |
|
8834 |
session.commit()
|
| - |
|
8835 |
|
| - |
|
8836 |
if order.source == OrderSource.STORE:
|
| - |
|
8837 |
sod = StoreOrderDetail.get_by(orderId = order.id)
|
| - |
|
8838 |
__push_store_collection_to_hotspot(order, "advance", sod.cashAmount, sod.cardAmount)
|
| - |
|
8839 |
logging.info("Successfully verified order no: " + str(order.id))
|
| - |
|
8840 |
return True
|
| - |
|
8841 |
else:
|
| - |
|
8842 |
logging.warning("Verify called for order no." + str(order.id) +" which is not in verification pending state");
|
| - |
|
8843 |
return False
|
| - |
|
8844 |
|
| - |
|
8845 |
def verify_orders_for_transaction(transactionId):
|
| - |
|
8846 |
transaction = get_transaction(transactionId)
|
| - |
|
8847 |
for order in transaction.orders:
|
| - |
|
8848 |
__verify_order(order)
|
| - |
|
8849 |
return True
|
| 8822 |
|
8850 |
|
| 8823 |
|
8851 |
|
| 8824 |
if __name__ == '__main__':
|
8852 |
if __name__ == '__main__':
|
| 8825 |
print get_orders_by_mobile_number("9650889334")
|
8853 |
print get_orders_by_mobile_number("9650889334")
|