Subversion Repositories SmartDukaan

Rev

Rev 4581 | Rev 4647 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4581 Rev 4600
Line 3... Line 3...
3
 
3
 
4
@author: ashish
4
@author: ashish
5
'''
5
'''
6
 
6
 
7
from shop2020.thriftpy.model.v1.order.ttypes import Transaction as T_Transaction,\
7
from shop2020.thriftpy.model.v1.order.ttypes import Transaction as T_Transaction,\
8
    LineItem as T_LineItem, Order as T_Order, Alert as T_Alert, OrderStatus, DelayReason
8
    LineItem as T_LineItem, Order as T_Order, Alert as T_Alert, OrderStatus, DelayReason, \
-
 
9
    PaymentSettlement as T_PaymentSettlement
9
from shop2020.utils.Utils import to_java_date
10
from shop2020.utils.Utils import to_java_date
10
from shop2020.model.v1.order.impl.DataService import Alert, Transaction
11
from shop2020.model.v1.order.impl.DataService import Alert, Transaction
11
 
12
 
12
def to_t_transaction(transaction):
13
def to_t_transaction(transaction):
13
    t_transaction = T_Transaction()
14
    t_transaction = T_Transaction()
Line 122... Line 123...
122
    except:
123
    except:
123
        pass
124
        pass
124
    t_alert.type = alert.type
125
    t_alert.type = alert.type
125
    t_alert.status = alert.status
126
    t_alert.status = alert.status
126
    return t_alert
127
    return t_alert
-
 
128
 
-
 
129
def to_t_payment_settlement(payment_settlement):
-
 
130
    t_payment_settlement = T_PaymentSettlement()
-
 
131
    
-
 
132
    if payment_settlement:
-
 
133
        t_payment_settlement.paymentId = payment_settlement.paymentId
-
 
134
        t_payment_settlement.gatewayTxnId = payment_settlement.gatewayTxnId
-
 
135
        t_payment_settlement.paymentGatewayId = payment_settlement.paymentGatewayId
-
 
136
        t_payment_settlement.settlementDate = to_java_date(payment_settlement.settlementDate)
-
 
137
        t_payment_settlement.serviceTax = payment_settlement.serviceTax
-
 
138
        t_payment_settlement.otherCharges = payment_settlement.otherCharges
-
 
139
        t_payment_settlement.netCollection = payment_settlement.netCollection
-
 
140
    return t_payment_settlement