Move all stripe stuff to stripe.py

This commit is contained in:
Nico Schottelius 2020-03-03 11:31:32 +01:00
parent e176ad0817
commit ea00e81b1e
2 changed files with 2 additions and 7 deletions

View file

@ -11,8 +11,6 @@ https://docs.djangoproject.com/en/3.0/ref/settings/
""" """
import os import os
import stripe
import ldap import ldap
# Uncommitted file with secrets # Uncommitted file with secrets
@ -174,5 +172,3 @@ USE_TZ = True
# https://docs.djangoproject.com/en/3.0/howto/static-files/ # https://docs.djangoproject.com/en/3.0/howto/static-files/
STATIC_URL = '/static/' STATIC_URL = '/static/'
stripe.api_key = uncloud.secrets.STRIPE_KEY

View file

@ -2,13 +2,12 @@ import stripe
import stripe.error import stripe.error
import logging import logging
from django.conf import settings import uncloud.secrets
# Static stripe configuration used below. # Static stripe configuration used below.
CURRENCY = 'chf' CURRENCY = 'chf'
# Register stripe (secret) API key from config. stripe.api_key = uncloud.secrets.STRIPE_KEY
stripe.api_key = settings.STRIPE_API_KEY
# Helper (decorator) used to catch errors raised by stripe logic. # Helper (decorator) used to catch errors raised by stripe logic.
def handle_stripe_error(f): def handle_stripe_error(f):