Skip to content

Commit

Permalink
Update src/Modules/OrchardCore.Commerce.Payment.Stripe/Handlers/Subsc…
Browse files Browse the repository at this point in the history
…riptionStripeWebhookEventHandler.cs

Co-authored-by: Sára El-Saig <[email protected]>
  • Loading branch information
wAsnk and sarahelsaig authored Jan 16, 2025
1 parent 2b27716 commit 2ccec92
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ public async Task ReceivedStripeEventAsync(Event stripeEvent)
subscriptionPart.Status.Text = SubscriptionStatuses.Active;

// invoice.PeriodEnd doesn't show the current period, see Stripe docs:
// End of the usage period during which invoice items were added to this invoice. This looks back one
// period for a subscription invoice. Use the line item period to get the service period for each price.
// https://docs.stripe.com/api/invoices/object#invoice_object-period_end
// "End of the usage period during which invoice items were added to this invoice. This looks back one
// period for a subscription invoice. Use the line item period to get the service period for each price."
subscriptionPart.EndDateUtc.Value = invoice.Lines.Data.Find(data => !data.Proration)?.Period.End;
subscriptionPart.PaymentProviderName.Text = StripePaymentProvider.ProviderName;
subscriptionPart.IdInPaymentProvider.Text = invoice.SubscriptionId;
Expand Down

0 comments on commit 2ccec92

Please sign in to comment.