Rev 701 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
'''Created on 26-Aug-2010@author: ashish'''from shop2020.payments.impl.DataService import Pmntfrom shop2020.thriftpy import paymentsfrom shop2020.utils.Utils import to_java_datedef to_t_payment(pmnt):payment = payments.ttypes.Payment()payment.merchant_tx_id = str(pmnt.id)payment.cart_id = pmnt.cart_idpayment.user_id = pmnt.user_idpayment.amount = pmnt.amtif pmnt.init_ts:payment.init_timestamp = to_java_date(pmnt.init_ts)if pmnt.ba_ts:payment.bank_ack_timestamp = to_java_date(pmnt.ba_ts)payment.status = pmnt.pspayment.gateway_id = pmnt.gatewayif pmnt.bid:payment.payment_id = pmnt.bidif pmnt.error_code:payment.error_code = pmnt.error_codeif pmnt.session_id:payment.session_id = pmnt.session_idif pmnt.ref_code:payment.ref_code = pmnt.ref_codeif pmnt.auth_code:payment.auth_code = pmnt.auth_codeif pmnt.post_date:payment.post_date = pmnt.post_datereturn payment