From ea00e81b1e99d6b7f6b207447b0c2157a0c40ca3 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 3 Mar 2020 11:31:32 +0100 Subject: [PATCH] Move all stripe stuff to stripe.py --- uncloud/uncloud/settings.py | 4 ---- uncloud/uncloud_pay/stripe.py | 5 ++--- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/uncloud/uncloud/settings.py b/uncloud/uncloud/settings.py index c6c89d5..cc0ec3a 100644 --- a/uncloud/uncloud/settings.py +++ b/uncloud/uncloud/settings.py @@ -11,8 +11,6 @@ https://docs.djangoproject.com/en/3.0/ref/settings/ """ import os - -import stripe import ldap # Uncommitted file with secrets @@ -174,5 +172,3 @@ USE_TZ = True # https://docs.djangoproject.com/en/3.0/howto/static-files/ STATIC_URL = '/static/' - -stripe.api_key = uncloud.secrets.STRIPE_KEY diff --git a/uncloud/uncloud_pay/stripe.py b/uncloud/uncloud_pay/stripe.py index 6399a1a..c50317f 100644 --- a/uncloud/uncloud_pay/stripe.py +++ b/uncloud/uncloud_pay/stripe.py @@ -2,13 +2,12 @@ import stripe import stripe.error import logging -from django.conf import settings +import uncloud.secrets # Static stripe configuration used below. CURRENCY = 'chf' -# Register stripe (secret) API key from config. -stripe.api_key = settings.STRIPE_API_KEY +stripe.api_key = uncloud.secrets.STRIPE_KEY # Helper (decorator) used to catch errors raised by stripe logic. def handle_stripe_error(f):