Configure PayPal integration and cart checkout error display
This commit is contained in:
1 parent
62065828e1
commit
cf07fc5d9b
98 files changed
+1430
-281
No files matched your search
@@ -24,7 +24,14 @@ class Product(models.Model):
|
||||
image = models.ImageField(upload_to='shop/products/', blank=True)
|
||||
price_usd = models.DecimalField(max_digits=9, decimal_places=2, validators=[MinValueValidator(Decimal('0.50'))])
|
||||
active = models.BooleanField(default=True)
|
||||
comparison = models.TextField(blank=True, max_length=3000,
|
||||
help_text='One benefit per line, using Feature: Details. Used on the membership comparison chart.')
|
||||
featured = models.BooleanField(default=False)
|
||||
sample_chapter = models.ForeignKey('catalog.Chapter', null=True, blank=True, on_delete=models.SET_NULL,
|
||||
related_name='shop_editions')
|
||||
member_tier = models.PositiveSmallIntegerField(choices=[(1, 'Early Access'), (2, 'Studio Vault'), (3, 'Collector’s Circle')],
|
||||
null=True, blank=True)
|
||||
verified_by_seller = models.BooleanField(default=False, help_text="Show the Verified by Seller badge on this listing.")
|
||||
position = models.PositiveIntegerField(default=0)
|
||||
|
||||
# Physical inventory & shipping
|
||||
@@ -96,6 +103,7 @@ class Order(models.Model):
|
||||
# Gateway tracking
|
||||
gateway_session_id = models.CharField(max_length=200, blank=True, db_index=True)
|
||||
gateway_payment_id = models.CharField(max_length=200, blank=True)
|
||||
stripe_live = models.BooleanField(null=True, editable=False)
|
||||
paid_at = models.DateTimeField(null=True, blank=True)
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
|
||||
@@ -113,6 +121,7 @@ class Order(models.Model):
|
||||
class OrderItem(models.Model):
|
||||
order = models.ForeignKey(Order, on_delete=models.CASCADE, related_name='items')
|
||||
product = models.ForeignKey(Product, on_delete=models.PROTECT)
|
||||
chapter = models.ForeignKey('catalog.Chapter', null=True, blank=True, on_delete=models.PROTECT)
|
||||
title_snapshot = models.CharField(max_length=160)
|
||||
unit_price_usd = models.DecimalField(max_digits=9, decimal_places=2)
|
||||
quantity = models.PositiveIntegerField(default=1)
|
||||
@@ -137,6 +146,8 @@ class Subscription(models.Model):
|
||||
gateway_sub_id = models.CharField(max_length=200, blank=True, db_index=True)
|
||||
gateway_customer_id = models.CharField(max_length=200, blank=True)
|
||||
status = models.CharField(max_length=20, choices=Status.choices, default=Status.PENDING)
|
||||
stripe_live = models.BooleanField(null=True, editable=False)
|
||||
entitlement_tier = models.PositiveSmallIntegerField(null=True, editable=False)
|
||||
current_period_end = models.DateTimeField(null=True, blank=True)
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
|
||||
|
||||
Reference in new issue
Block a user