mirror of
https://github.com/bitwarden/server.git
synced 2024-11-24 12:35:25 +01:00
resolve stripe plan upgrade when payment fails (#4783)
Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
This commit is contained in:
parent
3824f0f821
commit
459f37a4c6
@ -231,9 +231,19 @@ public class UpgradeOrganizationPlanCommand : IUpgradeOrganizationPlanCommand
|
||||
}
|
||||
else
|
||||
{
|
||||
paymentIntentClientSecret = await _paymentService.UpgradeFreeOrganizationAsync(organization,
|
||||
newPlan, upgrade);
|
||||
success = string.IsNullOrWhiteSpace(paymentIntentClientSecret);
|
||||
try
|
||||
{
|
||||
paymentIntentClientSecret = await _paymentService.UpgradeFreeOrganizationAsync(organization,
|
||||
newPlan, upgrade);
|
||||
success = string.IsNullOrWhiteSpace(paymentIntentClientSecret);
|
||||
}
|
||||
catch
|
||||
{
|
||||
await _paymentService.CancelAndRecoverChargesAsync(organization);
|
||||
organization.GatewayCustomerId = null;
|
||||
await _organizationService.ReplaceAndUpdateCacheAsync(organization);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user