def ProcessPlayerAuctions(self, pArgumentDic):
        tPaOrder = PaOrder()

        if ('mc_gross' in pArgumentDic.keys()):
            tPaOrder.paAmount = pArgumentDic['mc_gross']

        if ('payer_id' in pArgumentDic.keys()):
            tPaOrder.paTransactionId = pArgumentDic['payer_id']

        tPaOrder.put()
    def ProcessPlayerAuctions(self, pArgumentDic):
        tPaOrder = PaOrder()

        if "mc_gross" in pArgumentDic.keys():
            tPaOrder.paAmount = pArgumentDic["mc_gross"]

        if "payer_id" in pArgumentDic.keys():
            tPaOrder.paTransactionId = pArgumentDic["payer_id"]

        tPaOrder.put()
Beispiel #3
0
    def receive(self, mail_message):
        #logging.debug("Received a message from: " + PaOrderHandler.unwraptext(mail_message.sender))
        #logging.debug("Subject: " + PaOrderHandler.unwraptext(mail_message.subject))

        for bodies in mail_message.bodies('text/plain'):
            emailtext = ""
            for body in bodies:
                try:
                    encodedtext = body[1]
                    emailtext = PaOrderHandler.unwraptext(encodedtext)
                except:
                    emailtext = body.payload.decode(body.encoding)

                if (isinstance(emailtext, unicode)):
                    emailtext = emailtext.encode('utf-8')

            #logging.debug("Body PlainText: " + emailtext)

        OrderAmountText = self.reOrder.search(
            emailtext).groupdict()['order'].strip()
        OrderAmountInt = NumberToGp.ConvertBetToInt(OrderAmountText)
        OrderId = self.reOrderId.search(
            emailtext).groupdict()['orderid'].strip()

        tMatchingOrderQuery = PaOrder.all()
        tMatchingOrderQuery.filter("paTransactionId", OrderId)

        tMatches = tMatchingOrderQuery.fetch(10)

        if (len(tMatches) > 0):
            return

        tPaOrder = PaOrder()
        tPaOrder.paAmount = OrderAmountText
        tPaOrder.paAmountInt = OrderAmountInt
        tPaOrder.paTransactionId = OrderId

        tAssignedAgentClass = DeliveryAssignment()
        tAssignedAgent = tAssignedAgentClass.GetAssignedAgent()

        if (tAssignedAgent != 'No Agent Online'):
            tPaOrder.paAssignedAgent = tAssignedAgent.agentId
            tPaOrder.paAssignedAgentNick = tAssignedAgent.agentNickName
        else:
            tPaOrder.paAssignedAgent = "No Agent Online"
            tPaOrder.paAssignedAgentNick = "No Agent Online"

        tPaOrder.put()
    def receive(self, mail_message):
        #logging.debug("Received a message from: " + PaOrderHandler.unwraptext(mail_message.sender))
        #logging.debug("Subject: " + PaOrderHandler.unwraptext(mail_message.subject))

        for bodies in mail_message.bodies('text/plain'):
            emailtext = ""
            for body in bodies:
                try:
                    encodedtext = body[1]
                    emailtext = PaOrderHandler.unwraptext(encodedtext)
                except:
                    emailtext = body.payload.decode(body.encoding)
                    
                if(isinstance(emailtext, unicode)):
                    emailtext = emailtext.encode('utf-8')
                
            #logging.debug("Body PlainText: " + emailtext)
            
        OrderAmountText = self.reOrder.search(emailtext).groupdict()['order'].strip()
        OrderAmountInt = NumberToGp.ConvertBetToInt(OrderAmountText)
        OrderId = self.reOrderId.search(emailtext).groupdict()['orderid'].strip()
        
        tMatchingOrderQuery = PaOrder.all()
        tMatchingOrderQuery.filter("paTransactionId", OrderId)
        
        tMatches = tMatchingOrderQuery.fetch(10)
        
        if(len(tMatches) > 0):
            return
        
        tPaOrder = PaOrder()
        tPaOrder.paAmount = OrderAmountText
        tPaOrder.paAmountInt = OrderAmountInt
        tPaOrder.paTransactionId = OrderId

        tAssignedAgentClass = DeliveryAssignment() 
        tAssignedAgent = tAssignedAgentClass.GetAssignedAgent()
        
        if(tAssignedAgent != 'No Agent Online'):
            tPaOrder.paAssignedAgent = tAssignedAgent.agentId
            tPaOrder.paAssignedAgentNick = tAssignedAgent.agentNickName
        else:
            tPaOrder.paAssignedAgent = "No Agent Online"
            tPaOrder.paAssignedAgentNick = "No Agent Online"
            
        tPaOrder.put()