integrace api, stripe, vytvoření commecre app
This commit is contained in:
18
backend/thirdparty/stripe/models.py
vendored
18
backend/thirdparty/stripe/models.py
vendored
@@ -1,3 +1,21 @@
|
||||
from django.db import models
|
||||
|
||||
# Create your models here.
|
||||
|
||||
class Order(models.Model):
|
||||
STATUS_CHOICES = [
|
||||
("pending", "Pending"),
|
||||
("paid", "Paid"),
|
||||
("failed", "Failed"),
|
||||
("cancelled", "Cancelled"),
|
||||
]
|
||||
|
||||
amount = models.DecimalField(max_digits=10, decimal_places=2)
|
||||
currency = models.CharField(max_length=10, default="czk")
|
||||
status = models.CharField(max_length=20, choices=STATUS_CHOICES, default="pending")
|
||||
stripe_session_id = models.CharField(max_length=255, blank=True, null=True)
|
||||
stripe_payment_intent = models.CharField(max_length=255, blank=True, null=True)
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
|
||||
def __str__(self):
|
||||
return f"Order {self.id} - {self.status}"
|
||||
Reference in New Issue
Block a user