Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send upcoming invoice to provider billing email #4112

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/Billing/Controllers/StripeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,23 @@
await SendEmails(new List<string> { user.Email });
}
}
else if (providerId.HasValue)
{
var provider = await _providerRepository.GetByIdAsync(providerId.Value);

Check warning on line 720 in src/Billing/Controllers/StripeController.cs

View check run for this annotation

Codecov / codecov/patch

src/Billing/Controllers/StripeController.cs#L719-L720

Added lines #L719 - L720 were not covered by tests

if (provider == null)
{
_logger.LogError(
"Received invoice.Upcoming webhook ({EventID}) for Provider ({ProviderID}) that does not exist",
parsedEvent.Id,
providerId.Value);

Check warning on line 727 in src/Billing/Controllers/StripeController.cs

View check run for this annotation

Codecov / codecov/patch

src/Billing/Controllers/StripeController.cs#L723-L727

Added lines #L723 - L727 were not covered by tests

return;

Check warning on line 729 in src/Billing/Controllers/StripeController.cs

View check run for this annotation

Codecov / codecov/patch

src/Billing/Controllers/StripeController.cs#L729

Added line #L729 was not covered by tests
}

await SendEmails(new List<string> { provider.BillingEmail });

Check warning on line 732 in src/Billing/Controllers/StripeController.cs

View check run for this annotation

Codecov / codecov/patch

src/Billing/Controllers/StripeController.cs#L732

Added line #L732 was not covered by tests

}

Check warning on line 734 in src/Billing/Controllers/StripeController.cs

View check run for this annotation

Codecov / codecov/patch

src/Billing/Controllers/StripeController.cs#L734

Added line #L734 was not covered by tests

return;

Expand Down
Loading