mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-04 05:39:06 +00:00
Create API webhook, endpoints for subscription payments using Stripe
- Add fields to mark users as subscribed to a specific plan and subscription renewal date in DB - Add ability to unsubscribe a user using their email address - Expose webhook for stripe to callback confirming payment
This commit is contained in:
@@ -14,7 +14,15 @@ class BaseModel(models.Model):
|
||||
|
||||
|
||||
class KhojUser(AbstractUser):
|
||||
class SubscriptionType(models.TextChoices):
|
||||
TRIAL = "trial"
|
||||
STANDARD = "standard"
|
||||
|
||||
uuid = models.UUIDField(models.UUIDField(default=uuid.uuid4, editable=False))
|
||||
subscription_type = models.CharField(
|
||||
max_length=20, choices=SubscriptionType.choices, default=SubscriptionType.TRIAL
|
||||
)
|
||||
subscription_renewal_date = models.DateTimeField(null=True, default=None)
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
if not self.uuid:
|
||||
|
||||
Reference in New Issue
Block a user