1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-14 14:17:35 -05:00
Files
bitwarden/src/Core/Billing/Payment/Models/BillingAddress.cs
Alex Morask 7f65a655d4 [PM-21881] Manage payment details outside of checkout (#6032)
* Add feature flag

* Further establish billing command pattern and use in PreviewTaxAmountCommand

* Add billing address models/commands/queries/tests

* Update TypeReadingJsonConverter to account for new union types

* Add payment method models/commands/queries/tests

* Add credit models/commands/queries/tests

* Add command/query registrations

* Add new endpoints to support new command model and payment functionality

* Run dotnet format

* Add InjectUserAttribute for easier AccountBillilngVNextController handling

* Add InjectOrganizationAttribute for easier OrganizationBillingVNextController handling

* Add InjectProviderAttribute for easier ProviderBillingVNextController handling

* Add XML documentation for billing command pipeline

* Fix StripeConstants post-nullability

* More nullability cleanup

* Run dotnet format
2025-07-10 08:32:25 -05:00

31 lines
901 B
C#

#nullable enable
using Stripe;
namespace Bit.Core.Billing.Payment.Models;
public record TaxID(string Code, string Value);
public record BillingAddress
{
public required string Country { get; set; }
public required string PostalCode { get; set; }
public string? Line1 { get; set; }
public string? Line2 { get; set; }
public string? City { get; set; }
public string? State { get; set; }
public TaxID? TaxId { get; set; }
public static BillingAddress From(Address address) => new()
{
Country = address.Country,
PostalCode = address.PostalCode,
Line1 = address.Line1,
Line2 = address.Line2,
City = address.City,
State = address.State
};
public static BillingAddress From(Address address, TaxId? taxId) =>
From(address) with { TaxId = taxId != null ? new TaxID(taxId.Type, taxId.Value) : null };
}