Make payment options db configurable

This commit is contained in:
Kumi 2021-05-24 14:02:50 +02:00
parent d6b7748245
commit 4b2ab3640c

View file

@ -9,6 +9,8 @@ from django.http import Http404
from smsauth.views import requestToken
from buyer.views import getCard, sendStatus
from ledger.models import Payment
from dbsettings.functions import getValue
from decimal import Decimal
def makeCardURL(card):
return CardURL.objects.create(card=card) # pylint: disable=E1101
@ -32,7 +34,7 @@ class SMSAuthView(LoginRequiredMixin, FormView):
except:
return redirect("unavailable")
if not card.delivered:
Payment.objects.create(description="Paysafecard", amount=11, card=card) # pylint: disable=E1101
Payment.objects.create(description=getValue("ledger.description", "Paysafecard"), amount=Decimal(getValue("ledger.amount", 11)), card=card) # pylint: disable=E1101
return redirect(return_url)
class CardView(LoginRequiredMixin, DetailView):