Skip to content

Commit 25a00e2

Browse files
Copilotniemyjski
andcommitted
Apply code review suggestions: use String.Equals for status comparison and filter deleted discounts
Co-authored-by: niemyjski <[email protected]>
1 parent 1f13ded commit 25a00e2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Exceptionless.Web/Controllers/OrganizationController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ public async Task<ActionResult<Invoice>> GetInvoiceAsync(string id)
239239
OrganizationId = organization.Id,
240240
OrganizationName = organization.Name,
241241
Date = stripeInvoice.Created,
242-
Paid = stripeInvoice.Status == "paid",
242+
Paid = String.Equals(stripeInvoice.Status, "paid"),
243243
Total = stripeInvoice.Total / 100.0m
244244
};
245245

@@ -260,7 +260,7 @@ public async Task<ActionResult<Invoice>> GetInvoiceAsync(string id)
260260
invoice.Items.Add(item);
261261
}
262262

263-
var coupon = stripeInvoice.Discounts?.FirstOrDefault()?.Coupon;
263+
var coupon = stripeInvoice.Discounts?.FirstOrDefault(d => d.Deleted is false)?.Coupon;
264264
if (coupon is not null)
265265
{
266266
if (coupon.AmountOff.HasValue)

0 commit comments

Comments
 (0)