mirror of
https://github.com/bitwarden/server
synced 2025-12-10 05:13:48 +00:00
Create customer for client organization that was converted to BU upon unlinking (#5706)
This commit is contained in:
@@ -110,9 +110,14 @@ public class RemoveOrganizationFromProviderCommand : IRemoveOrganizationFromProv
|
|||||||
IEnumerable<string> organizationOwnerEmails)
|
IEnumerable<string> organizationOwnerEmails)
|
||||||
{
|
{
|
||||||
if (provider.IsBillable() &&
|
if (provider.IsBillable() &&
|
||||||
organization.IsValidClient() &&
|
organization.IsValidClient())
|
||||||
!string.IsNullOrEmpty(organization.GatewayCustomerId))
|
|
||||||
{
|
{
|
||||||
|
// 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
|
var customer = await _stripeAdapter.CustomerUpdateAsync(organization.GatewayCustomerId, new CustomerUpdateOptions
|
||||||
{
|
{
|
||||||
Description = string.Empty,
|
Description = string.Empty,
|
||||||
|
|||||||
Reference in New Issue
Block a user