Skip to content

Commit b0bc8c4

Browse files
Copilotniemyjski
andcommitted
Fix InvoiceLineItem.Price property access for Stripe.net v48 compatibility
Co-authored-by: niemyjski <1020579+niemyjski@users.noreply.github.com>
1 parent 25a00e2 commit b0bc8c4

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/Exceptionless.Web/Controllers/OrganizationController.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,11 +246,13 @@ public async Task<ActionResult<Invoice>> GetInvoiceAsync(string id)
246246
foreach (var line in stripeInvoice.Lines.Data)
247247
{
248248
var item = new InvoiceLineItem { Amount = line.Amount / 100.0m, Description = line.Description };
249-
if (line.Price is not null)
249+
// Note: In Stripe.net v48, Price property was removed from InvoiceLineItem
250+
// We'll use available properties and fallback to basic information
251+
if (!String.IsNullOrEmpty(line.PriceId))
250252
{
251-
string planName = line.Price.Nickname ?? _billingManager.GetBillingPlan(line.Price.Id)?.Name ?? line.Price.Id;
252-
var intervalText = line.Price.Recurring?.Interval ?? "one-time";
253-
var priceAmount = line.Price.UnitAmount.HasValue ? (line.Price.UnitAmount.Value / 100.0) : 0.0;
253+
string planName = _billingManager.GetBillingPlan(line.PriceId)?.Name ?? line.PriceId;
254+
var intervalText = "one-time"; // Default since Recurring info is not directly available on line item
255+
var priceAmount = line.UnitAmount.HasValue ? (line.UnitAmount.Value / 100.0) : 0.0;
254256
item.Description = $"Exceptionless - {planName} Plan ({priceAmount:c}/{intervalText})";
255257
}
256258

0 commit comments

Comments
 (0)