| Line 5... |
Line 5... |
| 5 |
'''
|
5 |
'''
|
| 6 |
from elixir import session
|
6 |
from elixir import session
|
| 7 |
from shop2020.model.v1.order.impl import DataService, RedExpressUpdateService
|
7 |
from shop2020.model.v1.order.impl import DataService, RedExpressUpdateService
|
| 8 |
from shop2020.model.v1.order.impl.Convertors import to_t_transaction, to_t_alert, \
|
8 |
from shop2020.model.v1.order.impl.Convertors import to_t_transaction, to_t_alert, \
|
| 9 |
to_t_order, to_t_lineitem, to_t_payment_settlement, to_t_verification_agent, \
|
9 |
to_t_order, to_t_lineitem, to_t_payment_settlement, to_t_verification_agent, \
|
| 10 |
to_t_attribute, to_t_rechargeTransaction, to_t_frc, to_t_hotspot, to_t_sourcedetail
|
10 |
to_t_attribute, to_t_rechargeTransaction, to_t_frc, to_t_hotspot, to_t_sourcedetail, \
|
| - |
|
11 |
to_t_amazonorder
|
| 11 |
from shop2020.model.v1.order.impl.DataAccessors import create_transaction, \
|
12 |
from shop2020.model.v1.order.impl.DataAccessors import create_transaction, \
|
| 12 |
get_transactions_for_customer, get_transaction_status, get_line_items_for_order, \
|
13 |
get_transactions_for_customer, get_transaction_status, get_line_items_for_order, \
|
| 13 |
get_transaction, get_transactions_for_shopping_cart_id, \
|
14 |
get_transaction, get_transactions_for_shopping_cart_id, \
|
| 14 |
change_transaction_status, get_orders_for_customer, get_orders_for_transaction, \
|
15 |
change_transaction_status, get_orders_for_customer, get_orders_for_transaction, \
|
| 15 |
get_order, get_returnable_orders_for_customer, \
|
16 |
get_order, get_returnable_orders_for_customer, \
|
| Line 67... |
Line 68... |
| 67 |
create_recharge_transaction, get_physical_orders, get_document, retrieve_invoice, \
|
68 |
create_recharge_transaction, get_physical_orders, get_document, retrieve_invoice, \
|
| 68 |
change_shipping_address, get_recharge_transactions, get_recharge_transaction, \
|
69 |
change_shipping_address, get_recharge_transactions, get_recharge_transaction, \
|
| 69 |
get_frcs, get_hotspot_store, get_circle, retrieve_hotspot_recharge_invoice, \
|
70 |
get_frcs, get_hotspot_store, get_circle, retrieve_hotspot_recharge_invoice, \
|
| 70 |
get_recharge_trans, split_freebie_order, get_recharge_transactions_by_number, \
|
71 |
get_recharge_trans, split_freebie_order, get_recharge_transactions_by_number, \
|
| 71 |
update_hotspot_store_password, get_source_detail, get_all_circles, delete_frcs,\
|
72 |
update_hotspot_store_password, get_source_detail, get_all_circles, delete_frcs,\
|
| 72 |
topup_company_wallet, get_wallet_balance_for_company
|
73 |
topup_company_wallet, get_wallet_balance_for_company, \
|
| - |
|
74 |
add_amazon_order, get_order_for_amazonordercode, get_amazon_orders_shipped, get_amazon_orders_cancelled
|
| 73 |
from shop2020.model.v1.order.impl.model.DTHRechargeOrder import DTHRechargeOrder
|
75 |
from shop2020.model.v1.order.impl.model.DTHRechargeOrder import DTHRechargeOrder
|
| 74 |
from shop2020.model.v1.order.impl.model.DigitalTransaction import \
|
76 |
from shop2020.model.v1.order.impl.model.DigitalTransaction import \
|
| 75 |
DigitalTransaction
|
77 |
DigitalTransaction
|
| 76 |
from shop2020.model.v1.order.impl.model.MobileRechargeOrder import \
|
78 |
from shop2020.model.v1.order.impl.model.MobileRechargeOrder import \
|
| 77 |
MobileRechargeOrder
|
79 |
MobileRechargeOrder
|
| Line 2009... |
Line 2011... |
| 2009 |
def getWalletBalanceForCompany(self, companyId):
|
2011 |
def getWalletBalanceForCompany(self, companyId):
|
| 2010 |
try:
|
2012 |
try:
|
| 2011 |
return get_wallet_balance_for_company(companyId)
|
2013 |
return get_wallet_balance_for_company(companyId)
|
| 2012 |
finally:
|
2014 |
finally:
|
| 2013 |
self.closeSession()
|
2015 |
self.closeSession()
|
| 2014 |
|
2016 |
|
| - |
|
2017 |
def addAmazonOrder(self,amazonOrder):
|
| - |
|
2018 |
try:
|
| - |
|
2019 |
add_amazon_order(amazonOrder)
|
| - |
|
2020 |
except:
|
| - |
|
2021 |
self.closeSession()
|
| - |
|
2022 |
|
| - |
|
2023 |
def getOrderForAmazonOrderCode(self,order_id,status):
|
| - |
|
2024 |
result = None
|
| - |
|
2025 |
try:
|
| - |
|
2026 |
result = get_order_for_amazonordercode(order_id,status)
|
| - |
|
2027 |
except:
|
| - |
|
2028 |
result=False
|
| - |
|
2029 |
finally:
|
| - |
|
2030 |
self.closeSession()
|
| - |
|
2031 |
return result
|
| - |
|
2032 |
|
| - |
|
2033 |
def getAmazonOrdersShipped(self,interval):
|
| - |
|
2034 |
ordersShipped=None
|
| - |
|
2035 |
try:
|
| - |
|
2036 |
ordersShipped = get_amazon_orders_shipped(interval)
|
| - |
|
2037 |
except:
|
| - |
|
2038 |
ordersShipped=None
|
| - |
|
2039 |
finally:
|
| - |
|
2040 |
self.closeSession()
|
| - |
|
2041 |
return ordersShipped
|
| - |
|
2042 |
|
| - |
|
2043 |
def getAmazonOrdersCancelled(self,interval):
|
| - |
|
2044 |
ordersCancelled=None
|
| - |
|
2045 |
try:
|
| - |
|
2046 |
ordersCancelled = get_amazon_orders_cancelled(interval)
|
| - |
|
2047 |
except:
|
| - |
|
2048 |
ordersCancelled=None
|
| - |
|
2049 |
finally:
|
| - |
|
2050 |
self.closeSession()
|
| - |
|
2051 |
return ordersCancelled
|
| - |
|
2052 |
|
| 2015 |
def closeSession(self, ):
|
2053 |
def closeSession(self, ):
|
| 2016 |
close_session()
|
2054 |
close_session()
|
| 2017 |
|
2055 |
|
| 2018 |
def isAlive(self, ):
|
2056 |
def isAlive(self, ):
|
| 2019 |
"""
|
2057 |
"""
|