Skip to content

Commit

Permalink
Merge pull request 'feature/tariff-service-refund' (#117) from featur…
Browse files Browse the repository at this point in the history
…e/tariff-service-refund into develop
  • Loading branch information
pavelbannov committed Dec 16, 2024
2 parents a030cad + 8bfc61b commit 7481fc3
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions common/ASC.Core.Common/Billing/TariffService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,13 +213,25 @@ public async Task<Tariff> GetTariffAsync(int tenantId, bool withRequestToPayment

await UpdateCacheAsync(tariff.Id);
}
catch (Exception error)
catch (BillingNotFoundException billingNotFoundException)
{
if (error is not BillingNotFoundException)
if (tariff.Id != 0 && tariff.State == TariffState.Paid)
{
LogError(error, tenantId.ToString());
LogError(billingNotFoundException, tenantId.ToString());

tariff.DueDate = DateTime.Today.AddDays(-1);

if (await SaveBillingInfoAsync(tenantId, tariff))
{
tariff = await CalculateTariffAsync(tenantId, tariff);
await UpdateCacheAsync(tariff.Id);
}
}
}
catch (Exception error)
{
LogError(error, tenantId.ToString());
}

if (tariff.Id == 0)
{
Expand Down

0 comments on commit 7481fc3

Please sign in to comment.