1
0
mirror of https://github.com/bitwarden/server synced 2025-12-15 15:53:59 +00:00

Prevent Stripe call when creating org from reseller in admin (#3953)

This commit is contained in:
Alex Morask
2024-04-05 09:23:33 -04:00
committed by GitHub
parent b164f24c99
commit 4af7780bb8

View File

@@ -382,10 +382,14 @@ public class ProviderService : IProviderService
organization.BillingEmail = provider.BillingEmail;
await _organizationRepository.ReplaceAsync(organization);
await _stripeAdapter.CustomerUpdateAsync(organization.GatewayCustomerId, new CustomerUpdateOptions
if (!string.IsNullOrEmpty(organization.GatewayCustomerId))
{
Email = provider.BillingEmail
});
await _stripeAdapter.CustomerUpdateAsync(organization.GatewayCustomerId, new CustomerUpdateOptions
{
Email = provider.BillingEmail
});
}
await _eventService.LogProviderOrganizationEventAsync(providerOrganization, EventType.ProviderOrganization_Added);
}