Klaus-Uwe Mitterer
54e84be36a
Copy over payment system from kumi.xxx Add missing requirements Other stuff
21 lines
557 B
Python
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)
|