當前位置: 首頁>>代碼示例>>Python>>正文


Python Order.orderCombatLevel方法代碼示例

本文整理匯總了Python中models.order.Order.orderCombatLevel方法的典型用法代碼示例。如果您正苦於以下問題:Python Order.orderCombatLevel方法的具體用法?Python Order.orderCombatLevel怎麽用?Python Order.orderCombatLevel使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在models.order.Order的用法示例。


在下文中一共展示了Order.orderCombatLevel方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: ProcessOrder

# 需要導入模塊: from models.order import Order [as 別名]
# 或者: from models.order.Order import orderCombatLevel [as 別名]
    def ProcessOrder(self, pArgumentDic):
        tOrderHandler = OrderHandler()
        tCustomerHandler = CustomerHandler()
        tCustomer = Customer()
        tPaypalOrder = PaypalOrder()
        tArgumentDic = pArgumentDic

        # Assign Values from POST from Paypal IPN
        tTransactionId = tArgumentDic["txn_id"]
        tAlphaMatch = re.compile("[^A-Za-z0-9]+")
        tAlphaSpaceMatch = re.compile("[^A-Za-z0-9 ]+")

        # Short circuits the order process for special PA page
        if "payer_email" in tArgumentDic.keys():
            if tArgumentDic["payer_email"] == "[email protected]":
                tPaypalOrder.ProcessPlayerAuctions(tArgumentDic)
                return

        try:
            tGoldAmount = tArgumentDic["option_name7"]
        except:
            tGoldAmount = ""

        try:
            tCustomerFirstName = tAlphaSpaceMatch.sub("", tArgumentDic["first_name"])
        except:
            tCustomerFirstName = ""

        try:
            tCustomerLastName = tAlphaSpaceMatch.sub("", tArgumentDic["last_name"])
        except:
            tCustomerLastName = ""

        try:
            tCustomerName = tAlphaSpaceMatch.sub("", tArgumentDic["option_name1"])
        except:
            tCustomerName = ""

        try:
            tEmail = tArgumentDic["option_name2"]
        except:
            tEmail = ""
        tPaypalEmail = str(tArgumentDic["payer_email"]).lower()
        try:
            tMobilePhone = tArgumentDic["option_name3"]
            tMobilePhone = re.sub(r"\D", "", tMobilePhone)
        except:
            tMobilePhone = ""
        try:
            tRsName = tArgumentDic["option_name4"].strip().lower()
            tRsName = tRsName.replace(" ", "_")
            tRsName = tRsName.replace("-", "_")
        except:
            tRsName = ""
        try:
            tCombatLevel = ""
        except:
            tCombatLevel = ""

        # try:
        # tReferCode = str(tArgumentDic['option_name5']).strip()
        # except:
        tReferCode = ""

        try:
            tPromotionCode = str(tArgumentDic["option_name5"]).strip()
        except:
            tPromotionCode = ""

        tOrderIp = tArgumentDic["custom"]
        tMembers = ""

        try:
            tOrderQuery = Order.all().filter("orderTransactionId", tTransactionId)
            tOrder = tOrderQuery.fetch(1)[0]
        except:
            tOrder = Order()

        if "fake" in tArgumentDic.keys():
            # logging.debug('Fake key hit')
            # logging.debug(str(tArgumentDic['fake']))
            if tArgumentDic["fake"] == "True":
                tOrder.orderIsGenerated = True

        tOrder.orderFormName = tCustomerName
        tOrder.orderCombatLevel = tCombatLevel

        if len(tGoldAmount) == 0:
            tUrl = "https://api-3t.paypal.com/nvp"
            # tOperation = "AddressVerify"
            tOperation = "GetTransactionDetails"
            # Get Paypal Information
            # tPaypal = PaypalTrigger()
            tResultDictionary = {}
            tPaypalPayload = {}
            tPayload = {}
            tPaypalPayload["METHOD"] = tOperation
            tPaypalPayload["TRANSACTIONID"] = tTransactionId

            tPayloadEncoded = tOrderHandler.GeneratePayload(tPaypalPayload)
#.........這裏部分代碼省略.........
開發者ID:Kenneth-Posey,項目名稱:kens-old-projects,代碼行數:103,代碼來源:paypal.py


注:本文中的models.order.Order.orderCombatLevel方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。