-
-
Notifications
You must be signed in to change notification settings - Fork 515
Bump Stripe.net from 47.4.0 to 48.0.2 and fix breaking API changes #1938
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 6 commits
9dfee0a
2395dcf
b32732f
b2479a2
ea39f39
1f13ded
25a00e2
b0bc8c4
77a7c41
80a9faf
048364e
539e0ef
ba014dc
c07716a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -239,17 +239,19 @@ | |||||
OrganizationId = organization.Id, | ||||||
OrganizationName = organization.Name, | ||||||
Date = stripeInvoice.Created, | ||||||
Paid = stripeInvoice.Paid, | ||||||
Paid = stripeInvoice.Status == "paid", | ||||||
Total = stripeInvoice.Total / 100.0m | ||||||
}; | ||||||
|
||||||
foreach (var line in stripeInvoice.Lines.Data) | ||||||
{ | ||||||
var item = new InvoiceLineItem { Amount = line.Amount / 100.0m, Description = line.Description }; | ||||||
if (line.Plan is not null) | ||||||
if (line.Price is not null) | ||||||
{ | ||||||
string planName = line.Plan.Nickname ?? _billingManager.GetBillingPlan(line.Plan.Id)?.Name ?? line.Plan.Id; | ||||||
item.Description = $"Exceptionless - {planName} Plan ({(line.Plan.Amount / 100.0):c}/{line.Plan.Interval})"; | ||||||
string planName = line.Price.Nickname ?? _billingManager.GetBillingPlan(line.Price.Id)?.Name ?? line.Price.Id; | ||||||
Check failure on line 251 in src/Exceptionless.Web/Controllers/OrganizationController.cs
|
||||||
var intervalText = line.Price.Recurring?.Interval ?? "one-time"; | ||||||
var priceAmount = line.Price.UnitAmount.HasValue ? (line.Price.UnitAmount.Value / 100.0) : 0.0; | ||||||
item.Description = $"Exceptionless - {planName} Plan ({priceAmount:c}/{intervalText})"; | ||||||
} | ||||||
|
||||||
var periodStart = line.Period.Start >= DateTime.MinValue ? line.Period.Start : stripeInvoice.PeriodStart; | ||||||
|
@@ -258,7 +260,7 @@ | |||||
invoice.Items.Add(item); | ||||||
} | ||||||
|
||||||
var coupon = stripeInvoice.Discount?.Coupon; | ||||||
var coupon = stripeInvoice.Discounts?.FirstOrDefault()?.Coupon; | ||||||
|
var coupon = stripeInvoice.Discounts?.FirstOrDefault()?.Coupon; | |
var coupon = stripeInvoice.Discounts?.FirstOrDefault(d => d.Deleted is false)?.Coupon; |
Also see if we do have to do this null check on Discounts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot var coupon = stripeInvoice.Discounts?.FirstOrDefault(d => d.Deleted is false)?.Coupon;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applied the suggestion to filter out deleted discounts using FirstOrDefault(d => d.Deleted is false)
. The null check on Discounts
is already handled by the null-conditional operator ?.
. Fixed in 25a00e2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Paid = String.Equals(stripeInvoice.Status, "paid"),
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applied the suggestion to use
String.Equals()
for more robust string comparison. Fixed in 25a00e2.