1
0
mirror of https://github.com/bitwarden/server.git synced 2025-02-17 02:01:53 +01:00

use item plan name if no description

This commit is contained in:
Kyle Spearrin 2017-11-08 21:56:27 -05:00
parent 04cd4cded4
commit 78b28061b2

View File

@ -55,7 +55,18 @@ namespace Bit.Api.Models
public Item(StripeInvoiceLineItem item)
{
Amount = (item.Amount / 100).ToString("F");
Description = item.Description ?? "--";
if(!string.IsNullOrWhiteSpace(item.Description))
{
Description = item.Description;
}
else if(!string.IsNullOrWhiteSpace(item.Plan?.Name) && item.Quantity.GetValueOrDefault() > 0)
{
Description = $"{item.Quantity} x {item.Plan.Name}";
}
else
{
Description = "--";
}
}
public string Description { get; set; }