JourneyJoker/payment/sepa/models.py
Klaus-Uwe Mitterer 54e84be36a Implement login system
Copy over payment system from kumi.xxx
Add missing requirements
Other stuff
2021-03-21 16:50:50 +01:00

21 lines
557 B
Python

from payment.models import InvoicePayment, Invoice
from django.db import models
import random
import string
from .functions import generate_reference
class SepaPaymentReference(models.Model):
invoice = models.ForeignKey(Invoice, models.CASCADE)
reference = models.IntegerField(default=generate_reference)
class SepaInvoicePayment(InvoicePayment):
@property
def gateway(self):
return "Bank Transfer"
@staticmethod
def initiate(subscription):
SepaPaymentReference.objects.get_or_create(subscription=subscription)