| Line 81... |
Line 81... |
| 81 |
import os
|
81 |
import os
|
| 82 |
import sys
|
82 |
import sys
|
| 83 |
import time
|
83 |
import time
|
| 84 |
import traceback
|
84 |
import traceback
|
| 85 |
import urllib
|
85 |
import urllib
|
| - |
|
86 |
import base64
|
| 86 |
|
87 |
|
| 87 |
|
88 |
|
| 88 |
logging.basicConfig(level=logging.DEBUG)
|
89 |
logging.basicConfig(level=logging.DEBUG)
|
| 89 |
|
90 |
|
| 90 |
sourceId = int(ConfigClient().get_property("sourceid"))
|
91 |
sourceId = int(ConfigClient().get_property("sourceid"))
|
| Line 421... |
Line 422... |
| 421 |
if voucherAmount:
|
422 |
if voucherAmount:
|
| 422 |
__create_recharge_voucher_tracker(order, voucherAmount, VoucherType.SPICEDECK_MOBILE)
|
423 |
__create_recharge_voucher_tracker(order, voucherAmount, VoucherType.SPICEDECK_MOBILE)
|
| 423 |
session.commit()
|
424 |
session.commit()
|
| 424 |
|
425 |
|
| 425 |
try:
|
426 |
try:
|
| - |
|
427 |
if order.source == OrderSource.WEBSITE:
|
| 426 |
if new_status == TransactionStatus.COD_IN_PROCESS:
|
428 |
if new_status == TransactionStatus.COD_IN_PROCESS:
|
| 427 |
transaction_requiring_extra_processing = TransactionRequiringExtraProcessing()
|
429 |
transaction_requiring_extra_processing = TransactionRequiringExtraProcessing()
|
| 428 |
transaction_requiring_extra_processing.category = 'COD_VERIFICATION'
|
430 |
transaction_requiring_extra_processing.category = 'COD_VERIFICATION'
|
| 429 |
transaction_requiring_extra_processing.transaction_id = transaction_id
|
431 |
transaction_requiring_extra_processing.transaction_id = transaction_id
|
| 430 |
session.commit()
|
432 |
session.commit()
|
| 431 |
elif new_status == TransactionStatus.FLAGGED:
|
433 |
elif new_status == TransactionStatus.FLAGGED:
|
| 432 |
transaction_requiring_extra_processing = TransactionRequiringExtraProcessing()
|
434 |
transaction_requiring_extra_processing = TransactionRequiringExtraProcessing()
|
| 433 |
transaction_requiring_extra_processing.category = 'PAYMENT_FLAGGED'
|
435 |
transaction_requiring_extra_processing.category = 'PAYMENT_FLAGGED'
|
| 434 |
transaction_requiring_extra_processing.transaction_id = transaction_id
|
436 |
transaction_requiring_extra_processing.transaction_id = transaction_id
|
| 435 |
session.commit()
|
437 |
session.commit()
|
| - |
|
438 |
elif order.source == OrderSource.STORE and order.status == OrderStatus.COD_VERIFICATION_PENDING:
|
| - |
|
439 |
catalog_client = CatalogClient().get_client()
|
| - |
|
440 |
sourcePricing = catalog_client.getStorePricing(order.lineitems[0].item_id)
|
| - |
|
441 |
content = "<html><body>"
|
| - |
|
442 |
content += "<h2>Product: " + str(order.lineitems[0]) + "</h2>"
|
| - |
|
443 |
content += "<h2>Min Price: " + str(sourcePricing.minPrice) + "</h2>"
|
| - |
|
444 |
content += "<h2>Max Price: " + str(sourcePricing.maxPrice) + "</h2>"
|
| - |
|
445 |
content += "<h2>Recommended Price: " + str(sourcePricing.recommendedPrice) + "</h2>"
|
| - |
|
446 |
content += "<h2>Approval Requested for Price: " + str(order.total_amount) + "</h2>"
|
| - |
|
447 |
content += "<h3>Please click on link below to approve the order</h3>"
|
| - |
|
448 |
content += "<a href='http://support.shop2020.in:8080/Support/price-approval?xszbg=" + base64.b64encode(str(order.id)) + "'>Click here for Approval</a>"
|
| - |
|
449 |
content += "</body></html>"
|
| - |
|
450 |
store = get_hotspot_store(order.storeId, "")
|
| - |
|
451 |
helper_client = HelperClient().get_client()
|
| - |
|
452 |
helper_client.saveUserEmailForSending(store.approvalEmail.split(';'), "", "Price approval requested for " + str(order.lineitems[0]) + " in store " + store.hotspotId , content, str(transaction_id), "PriceApproval", [], [])
|
| - |
|
453 |
|
| 436 |
except Exception as e:
|
454 |
except Exception as e:
|
| 437 |
print "Error inserting transaction Id: " + str(transaction_id) + " due to " + str(e)
|
455 |
print "Error inserting transaction Id: " + str(transaction_id) + " due to " + str(e)
|
| 438 |
|
456 |
|
| 439 |
return True
|
457 |
return True
|
| 440 |
|
458 |
|