zoukankan      html  css  js  c++  java
  • 安装Braintree Python模块(braintree==3.45.0)

    一、项目的settings.py文件添加下列内容:

    # Braintree settings
    BRAINTREE_MERCHANT_ID = '保密'
    BRAINTREE_PUBLIC_KEY = '保密'
    BRAINTREE_PRIVATE_KEY = '保密'
    from braintree import Configuration, Environment
    Configuration.configure(
        Environment.parse_environment("sandbox"),  # 这一句重点,千万別写成 Environment.Sandbox
        # Environment.parse_environment("product"),
        BRAINTREE_MERCHANT_ID,
        BRAINTREE_PUBLIC_KEY,
        BRAINTREE_PRIVATE_KEY
    )
    

    二、Environment.parse_environment("sandbox"),  这一句重点,千万別写成 Environment.Sandbox ,

    原因如下:

    1、ctrl+鼠标左键点击上面代码的configure(参数1,参数2,参数3,参数4),会发现 参数1 要填 environment,

    2、为了找到 environment ,

    ctrl+鼠标左键点击上面代码的Environment,

    会发现类Environment里的函数  def parse_environment(environment),  返回值是  Environment.All[environment],

    正好 Environment.All["sandbox"] = Environment.Sandbox 

    @staticmethod
        def parse_environment(environment):
            if isinstance(environment, Environment) or environment is None:
                return environment
            try:
                return Environment.All[environment]
            # ...............................
    #........................................ Environment.All = { "development": Environment.Development, "integration": Environment.Development, "qa": Environment.QA, "sandbox": Environment.Sandbox, "production": Environment.Production }

      

  • 相关阅读:
    Logstash收集Tomcat日志
    Logstash收集日志
    ELK搭建&Logstash 日志收集
    ELK介绍
    中文分词器
    ES数据备份与恢复
    Python开发之路
    Linux阅读目录
    333
    22222222
  • 原文地址:https://www.cnblogs.com/tuobei/p/12529105.html
Copyright © 2011-2022 走看看