mirror of
https://github.com/bitwarden/server.git
synced 2025-07-12 21:27:35 -05:00

* 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
19 lines
709 B
C#
19 lines
709 B
C#
using Bit.Core.Billing.Payment.Models;
|
|
using Stripe;
|
|
|
|
namespace Bit.Core.Test.Billing.Extensions;
|
|
|
|
public static class StripeExtensions
|
|
{
|
|
public static bool HasExpansions(this BaseOptions options, params string[] expansions)
|
|
=> expansions.All(expansion => options.Expand.Contains(expansion));
|
|
|
|
public static bool Matches(this AddressOptions address, BillingAddress billingAddress) =>
|
|
address.Country == billingAddress.Country &&
|
|
address.PostalCode == billingAddress.PostalCode &&
|
|
address.Line1 == billingAddress.Line1 &&
|
|
address.Line2 == billingAddress.Line2 &&
|
|
address.City == billingAddress.City &&
|
|
address.State == billingAddress.State;
|
|
}
|