mirror of
https://github.com/bitwarden/server
synced 2025-12-27 13:43:18 +00:00
[PM-23687] Support free organizations on Payment Details page (#6084)
* Resolve JSON serialization bug in OneOf converters and organize pricing models * Support free organizations for payment method and billing address flows * Run dotnet format
This commit is contained in:
@@ -8,6 +8,7 @@ using Bit.Core.Test.Billing.Extensions;
|
||||
using Braintree;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using NSubstitute;
|
||||
using NSubstitute.ReturnsExtensions;
|
||||
using Stripe;
|
||||
using Xunit;
|
||||
using Customer = Stripe.Customer;
|
||||
@@ -35,6 +36,23 @@ public class GetPaymentMethodQueryTests
|
||||
_subscriberService);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Run_NoCustomer_ReturnsNull()
|
||||
{
|
||||
var organization = new Organization
|
||||
{
|
||||
Id = Guid.NewGuid()
|
||||
};
|
||||
|
||||
_subscriberService.GetCustomer(organization,
|
||||
Arg.Is<CustomerGetOptions>(options =>
|
||||
options.HasExpansions("default_source", "invoice_settings.default_payment_method"))).ReturnsNull();
|
||||
|
||||
var maskedPaymentMethod = await _query.Run(organization);
|
||||
|
||||
Assert.Null(maskedPaymentMethod);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Run_NoPaymentMethod_ReturnsNull()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user