AL lPyment methods fully fucntion onstripe and paypal on sandbox

This commit is contained in:
IGNY8 VPS (Salman)
2026-01-20 19:21:01 +00:00
parent c777e5ccb2
commit fa548c3da9
9 changed files with 605 additions and 30 deletions

View File

@@ -161,6 +161,10 @@ class PlanAdmin(ImportExportMixin, Igny8ModelAdmin):
('Stripe Integration', {
'fields': ('stripe_product_id', 'stripe_price_id')
}),
('PayPal Integration', {
'fields': ('paypal_plan_id',),
'description': 'PayPal subscription plan ID (required for PayPal subscriptions)'
}),
)
def bulk_set_active(self, request, queryset):

View File

@@ -0,0 +1,28 @@
# Generated by Django 5.2.10 on 2026-01-20 18:26
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('igny8_core_auth', '0035_account_bonus_credits'),
]
operations = [
migrations.AddField(
model_name='plan',
name='paypal_plan_id',
field=models.CharField(blank=True, help_text='PayPal subscription plan ID', max_length=255, null=True),
),
migrations.AlterField(
model_name='account',
name='status',
field=models.CharField(choices=[('active', 'Active'), ('suspended', 'Suspended'), ('trial', 'Trial'), ('cancelled', 'Cancelled'), ('pending_payment', 'Pending Payment')], default='active', max_length=20),
),
migrations.AlterField(
model_name='historicalaccount',
name='status',
field=models.CharField(choices=[('active', 'Active'), ('suspended', 'Suspended'), ('trial', 'Trial'), ('cancelled', 'Cancelled'), ('pending_payment', 'Pending Payment')], default='active', max_length=20),
),
]

View File

@@ -387,6 +387,9 @@ class Plan(models.Model):
stripe_product_id = models.CharField(max_length=255, blank=True, null=True, help_text="For Stripe plan sync")
stripe_price_id = models.CharField(max_length=255, blank=True, null=True, help_text="Monthly price ID for Stripe")
# PayPal Integration
paypal_plan_id = models.CharField(max_length=255, blank=True, null=True, help_text="PayPal subscription plan ID")
# Legacy field for backward compatibility
credits_per_month = models.IntegerField(default=0, validators=[MinValueValidator(0)], help_text="DEPRECATED: Use included_credits instead")