Rev 701 | Rev 743 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
'''Created on 26-Aug-2010@author: ashish'''from elixir import *class PaymentGateway(Entity):id = Field(Integer, primary_key=True, autoincrement=True)name = Field(String(100))aliasName = Field(String(100))url = Field(String(500))responseUrl = Field(String(500))errorUrl = Field(String(500))status = Field(Integer)addedOn = Field(DateTime)attributes = OneToMany("GatewayAttribute")using_options(shortnames=True)class GatewayAttribute(Entity):payment_gateway = ManyToOne("PaymentGateway", primary_key=True)name = Field(String(50), primary_key=True)value = Field(String(100))using_options(shortnames=True)class PaymentAttribute(Entity):payment = ManyToOne("Payment", primary_key=True)name = Field(String(50), primary_key=True)value = Field(String(100))using_options(shortnames=True)class Payment(Entity):id = Field(Integer, primary_key=True, autoincrement=True)gatewayId = Field(Integer)gatewayPaymentId = Field(String(50))merchantTxnId = Field(Integer)gatewayTxnId = Field(String(50))amount = Field(Float)gatewayTxnStatus = Field(String(20))status = Field(Integer)userId = Field(Integer)errorCode = Field(String(20))description = Field(String(50))authCode = Field(String(20))referenceCode = Field(String(20))sessionId = Field(String(50))gatewayTxnDate = Field(String(50))attributes = OneToMany("PaymentAttribute")initTimestamp = Field(DateTime)successTimestamp = Field(DateTime)errorTimestamp = Field(DateTime)using_options(shortnames=True)def initialize():metadata.bind = "sqlite:///payment.sqlite" #need to read it from configserver.metadata.bind.echo = Truesetup_all(True)if __name__=="__main__":initialize()