1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-25 23:02:17 -05: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 GitHub
parent cb2860c0c1
commit 5184d10995
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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,