当前位置: 首页>>代码示例>>Python>>正文


Python Order.orderFormName方法代码示例

本文整理汇总了Python中models.order.Order.orderFormName方法的典型用法代码示例。如果您正苦于以下问题:Python Order.orderFormName方法的具体用法?Python Order.orderFormName怎么用?Python Order.orderFormName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在models.order.Order的用法示例。


在下文中一共展示了Order.orderFormName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: ProcessOrder

# 需要导入模块: from models.order import Order [as 别名]
# 或者: from models.order.Order import orderFormName [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.orderFormName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。