furry/paypal_integration/models.py

19 lines
635 B
Python

from django.db import models
from django.conf import settings
class PayPalConfig(models.Model):
client_id = models.CharField(max_length=255)
client_secret = models.CharField(max_length=255)
is_sandbox = models.BooleanField(default=True)
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
class Meta:
verbose_name = 'PayPal Konfiguration'
verbose_name_plural = 'PayPal Konfigurationen'
def __str__(self):
return f"PayPal Config ({self.get_mode()})"
def get_mode(self):
return "Sandbox" if self.is_sandbox else "Live"