From 081d644d16a8cfb5fcb9e6a2027f9aaf6b53afa1 Mon Sep 17 00:00:00 2001 From: JamesRamm Date: Tue, 7 Feb 2017 20:57:37 +0000 Subject: [PATCH] Bring settings up to date with master --- longclaw/settings.py | 46 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 38 insertions(+), 8 deletions(-) diff --git a/longclaw/settings.py b/longclaw/settings.py index 59be624..fde422c 100644 --- a/longclaw/settings.py +++ b/longclaw/settings.py @@ -1,13 +1,43 @@ +''' +Default settings for longclaw apps +''' from django.conf import settings -DEFAULT_SHIPPING_RATE = getattr(settings, 'DEFAULT_SHIPPING_RATE', 3.95) -DEFAULT_SHIPPING_CARRIER = getattr( - settings, 'DEFAULT_SHIPPING_CARRIER', 'Royal Mail') -DEFAULT_SHIPPING_ENABLED = getattr(settings, 'DEFAULT_SHIPPING_ENABLED', True) - -PAYMENT_GATEWAY = getattr(settings, - 'PAYMENT_GATEWAY', - 'longclaw.checkout.gateways.BraintreePayment') +# The currency to use for payments CURRENCY = getattr(settings, "CURRENCY", "GBP") +# Default shipping rate to use when no configured ShippingCountry is found for a given address +DEFAULT_SHIPPING_RATE = getattr(settings, 'DEFAULT_SHIPPING_RATE', 3.95) + +# Default carrier to use for the default rate +DEFAULT_SHIPPING_CARRIER = getattr( + settings, 'DEFAULT_SHIPPING_CARRIER', 'Royal Mail') + +# Whether to fall back to using the default shipping rate if no ShippingCountry is found +# This means shipping worldwide +DEFAULT_SHIPPING_ENABLED = getattr(settings, 'DEFAULT_SHIPPING_ENABLED', True) + +# The payment gateway backend to use +# Can be 'longclaw.checkout.gateways.BraintreePayment', +# 'longclaw.checkout.gateways.PaypalVZeroPayment', +# 'longclaw.checkout.gateways.StripePayment' or 'longclaw.checkout.gateways.BasePayment' +# Or a custom implementation +PAYMENT_GATEWAY = getattr(settings, + 'PAYMENT_GATEWAY', + 'longclaw.checkout.gateways.BasePayment') + +# The product variant model to use. This allows custom implementations of product models. PRODUCT_VARIANT_MODEL = getattr(settings, 'PRODUCT_VARIANT_MODEL', 'products.ProductVariant') + + +# Only required if using Stripe as the payment gateway +STRIPE_PUBLISHABLE = getattr(settings, 'STRIPE_PUBLISHABLE', '') +STRIPE_SECRET = getattr(settings, 'STRIPE_SECRET', '') + +# Only required if using Braintree as the payment gateway +BRAINTREE_MERCHANT_ID = getattr(settings, 'BRAINTREE_MERCHANT_ID', '') +BRAINTREE_PUBLIC_KEY = getattr(settings, 'BRAINTREE_PUBLIC_KEY', '') +BRAINTREE_PRIVATE_KEY = getattr(settings, 'BRAINTREE_PRIVATE_KEY', '') + +# Only required for using paypal as the payment gateway +VZERO_ACCESS_TOKEN = getattr(settings, 'VZERO_ACCESS_TOKEN', '')