mirror of
https://github.com/bitwarden/server.git
synced 2025-07-04 01:22:50 -05:00
Add sponsorship validation to upcoming invoice webhook
This commit is contained in:
@ -195,7 +195,9 @@ namespace Bit.Core.Services
|
||||
private async Task ChangeOrganizationSponsorship(Organization org, OrganizationSponsorship sponsorship, bool applySponsorship)
|
||||
{
|
||||
var existingPlan = Utilities.StaticStore.GetPlan(org.PlanType);
|
||||
var sponsoredPlan = Utilities.StaticStore.GetSponsoredPlan(sponsorship.PlanSponsorshipType.Value);
|
||||
var sponsoredPlan = sponsorship != null ?
|
||||
Utilities.StaticStore.GetSponsoredPlan(sponsorship.PlanSponsorshipType.Value) :
|
||||
null;
|
||||
var subscriptionUpdate = new SponsorOrganizationSubscriptionUpdate(existingPlan, sponsoredPlan, applySponsorship);
|
||||
|
||||
await FinalizeSubscriptionChangeAsync(org, subscriptionUpdate, DateTime.UtcNow);
|
||||
|
Reference in New Issue
Block a user