From a445554e476beb68ae172d7563552618fb301b1c Mon Sep 17 00:00:00 2001 From: sondin <108917452+sondin@users.noreply.github.com> Date: Fri, 12 Sep 2025 20:34:47 +0800 Subject: [PATCH] fix current_period_end --- backend/billing/subscription_service.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/billing/subscription_service.py b/backend/billing/subscription_service.py index 5803bc06..9dfc2184 100644 --- a/backend/billing/subscription_service.py +++ b/backend/billing/subscription_service.py @@ -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() \ No newline at end of file +subscription_service = SubscriptionService()