forked from uncloud/uncloud
Add initial structure for payment methods
This commit is contained in:
parent
70a4fe4d90
commit
36fcff5149
6 changed files with 99 additions and 3 deletions
|
|
@ -68,7 +68,22 @@ class Order(models.Model):
|
|||
|
||||
# return amount # you get the picture
|
||||
|
||||
class PaymentMethod(models.Model):
|
||||
uuid = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
|
||||
owner = models.ForeignKey(get_user_model(),
|
||||
on_delete=models.CASCADE,
|
||||
editable=False)
|
||||
source = models.CharField(max_length=256,
|
||||
choices = (
|
||||
('stripe', 'Stripe'),
|
||||
('unknown', 'Unknown'),
|
||||
),
|
||||
default='stripe')
|
||||
description = models.TextField()
|
||||
primary = models.BooleanField(default=True)
|
||||
|
||||
class Meta:
|
||||
unique_together = [['owner', 'primary']]
|
||||
|
||||
class Payment(models.Model):
|
||||
uuid = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue