1
0
mirror of https://github.com/bitwarden/server synced 2025-12-06 00:03:34 +00:00

Create customer for client organization that was converted to BU upon unlinking (#5706)

This commit is contained in:
Alex Morask
2025-04-25 13:06:06 -04:00
committed by Alex Morask
parent 35df1c767f
commit 7f054a6837

View File

@@ -110,9 +110,14 @@ public class RemoveOrganizationFromProviderCommand : IRemoveOrganizationFromProv
IEnumerable<string> organizationOwnerEmails)
{
if (provider.IsBillable() &&
organization.IsValidClient() &&
!string.IsNullOrEmpty(organization.GatewayCustomerId))
organization.IsValidClient())
{
// An organization converted to a business unit will not have a Customer since it was given to the business unit.
if (string.IsNullOrEmpty(organization.GatewayCustomerId))
{
await _providerBillingService.CreateCustomerForClientOrganization(provider, organization);
}
var customer = await _stripeAdapter.CustomerUpdateAsync(organization.GatewayCustomerId, new CustomerUpdateOptions
{
Description = string.Empty,