Python django.conf.settings.BRAINTREE_MERCHANT_ID Examples

The following are 1 code examples of django.conf.settings.BRAINTREE_MERCHANT_ID(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module django.conf.settings , or try the search function .
Example #1
Source File: payments.py    From wagtailinvoices with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
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'")