Make payment options db configurable
This commit is contained in:
parent
d6b7748245
commit
4b2ab3640c
1 changed files with 4 additions and 2 deletions
|
@ -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):
|
||||
|
@ -51,4 +53,4 @@ class CardView(LoginRequiredMixin, DetailView):
|
|||
return obj
|
||||
|
||||
class UnavailableView(LoginRequiredMixin, TemplateView):
|
||||
template_name = "frontend/unavailable.html"
|
||||
template_name = "frontend/unavailable.html"
|
||||
|
|
Loading…
Reference in a new issue