本文整理汇总了Python中django.conf.settings.BRAINTREE_MERCHANT_ID属性的典型用法代码示例。如果您正苦于以下问题:Python settings.BRAINTREE_MERCHANT_ID属性的具体用法?Python settings.BRAINTREE_MERCHANT_ID怎么用?Python settings.BRAINTREE_MERCHANT_ID使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类django.conf.settings
的用法示例。
在下文中一共展示了settings.BRAINTREE_MERCHANT_ID属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: set_braintree_mode
# 需要导入模块: from django.conf import settings [as 别名]
# 或者: from django.conf.settings import BRAINTREE_MERCHANT_ID [as 别名]
def set_braintree_mode(mode):
if mode.lower() == "production":
print('Initalising production mode!')
braintree.Configuration.configure(
braintree.Environment.Production,
settings.BRAINTREE_MERCHANT_ID,
settings.BRAINTREE_PUBLIC_KEY,
settings.BRAINTREE_PRIVATE_KEY,
)
elif mode.lower() == "sandbox":
print('Initalising sandbox mode!')
braintree.Configuration.configure(
braintree.Environment.Sandbox,
settings.BRAINTREE_MERCHANT_ID,
settings.BRAINTREE_PUBLIC_KEY,
settings.BRAINTREE_PRIVATE_KEY,
)
else:
raise ValueError("BRAINTREE_MODE needs to be set to either 'production' or 'sandbox'")