1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-26 12:55:17 +01:00

Subscription update to maintain auto charge (#803)

This commit is contained in:
Chad Scharf 2020-06-29 20:29:19 -04:00 committed by GitHub
parent 130c3e4748
commit d7b00f6c27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View File

@ -381,11 +381,18 @@ namespace Bit.Core.Services
// This proration behavior prevents a false "credit" from
// being applied forward to the next month's invoice
ProrationBehavior = "none",
CollectionMethod = "charge_automatically",
});
throw;
}
}
// Change back the subscription collection method
await subscriptionService.UpdateAsync(sub.Id, new SubscriptionUpdateOptions
{
CollectionMethod = "charge_automatically",
});
organization.Seats = (short?)newSeatTotal;
await ReplaceAndUpdateCache(organization);
return paymentIntentClientSecret;

View File

@ -778,11 +778,18 @@ namespace Bit.Core.Services
// This proration behavior prevents a false "credit" from
// being applied forward to the next month's invoice
ProrationBehavior = "none",
CollectionMethod = "charge_automatically",
});
throw;
}
}
// Change back the subscription collection method
await subscriptionService.UpdateAsync(sub.Id, new SubscriptionUpdateOptions
{
CollectionMethod = "charge_automatically",
});
return paymentIntentClientSecret;
}