diff --git a/.claude/settings.local.json b/.claude/settings.local.json index c611f9a..52271af 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -24,7 +24,8 @@ "Bash(dotnet nuget locals:*)", "Bash(/mnt/c/vscode/vcart.me.novo/clean-build.sh:*)", "Bash(sed:*)", - "Bash(./clean-build.sh:*)" + "Bash(./clean-build.sh:*)", + "Bash(git add:*)" ] }, "enableAllProjectMcpServers": false diff --git a/src/BCards.Web/Controllers/StripeWebhookController.cs b/src/BCards.Web/Controllers/StripeWebhookController.cs index 4d4ad26..71922d5 100644 --- a/src/BCards.Web/Controllers/StripeWebhookController.cs +++ b/src/BCards.Web/Controllers/StripeWebhookController.cs @@ -279,11 +279,14 @@ public class StripeWebhookController : ControllerBase var subscription = await _subscriptionRepository.GetByStripeSubscriptionIdAsync(stripeSubscription.Id); if (subscription != null) { + var service = new SubscriptionItemService(); + var subItem = service.Get(stripeSubscription.Items.Data[0].Id); + // Update subscription status to active subscription.Status = "active"; subscription.UpdatedAt = DateTime.UtcNow; - subscription.CurrentPeriodStart = stripeSubscription.CurrentPeriodStart; - subscription.CurrentPeriodEnd = stripeSubscription.CurrentPeriodEnd; + subscription.CurrentPeriodStart = subItem.CurrentPeriodStart; + subscription.CurrentPeriodEnd = subItem.CurrentPeriodEnd; // Update plan type based on Stripe price ID var priceId = stripeSubscription.Items.Data.FirstOrDefault()?.Price.Id;