fix current_period_end

This commit is contained in:
sondin 2025-09-12 20:34:47 +08:00 committed by GitHub
parent b547135806
commit a445554e47
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -139,7 +139,7 @@ class SubscriptionService:
'id': stripe_subscription['id'],
'status': 'trialing',
'is_trial': True,
'current_period_end': stripe_subscription['current_period_end'],
'current_period_end': stripe_subscription["items"]["data"][0]['current_period_end'],
'cancel_at_period_end': stripe_subscription['cancel_at_period_end'],
'trial_end': stripe_subscription.get('trial_end'),
'price_id': price_id,
@ -153,7 +153,7 @@ class SubscriptionService:
'id': stripe_subscription['id'],
'status': stripe_subscription['status'],
'is_trial': False,
'current_period_end': stripe_subscription['current_period_end'],
'current_period_end': stripe_subscription["items"]["data"][0]['current_period_end'],
'cancel_at_period_end': stripe_subscription['cancel_at_period_end'],
'trial_end': stripe_subscription.get('trial_end'),
'price_id': price_id,
@ -600,4 +600,4 @@ class SubscriptionService:
}).eq('account_id', account_id).execute()
subscription_service = SubscriptionService()
subscription_service = SubscriptionService()