1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-04 09:32:48 -05:00

send payment failed emails

This commit is contained in:
Kyle Spearrin
2019-02-14 11:49:39 -05:00
parent f70ececa9d
commit 67146cd4be
9 changed files with 77 additions and 6 deletions

View File

@ -166,7 +166,7 @@ namespace Bit.Billing.Controllers
{
var items = invoice.Lines.Select(i => i.Description).ToList();
await _mailService.SendInvoiceUpcomingAsync(email, invoice.AmountDue / 100M,
invoice.NextPaymentAttempt.Value, items, ids.Item1.HasValue);
invoice.NextPaymentAttempt.Value, items, true);
}
}
else if(parsedEvent.Type.Equals("charge.succeeded"))
@ -409,7 +409,10 @@ namespace Bit.Billing.Controllers
if(!transactionResult.IsSuccess())
{
// TODO: Send payment failure email?
if(invoice.AttemptCount < 4)
{
await _mailService.SendPaymentFailedAsync(customer.Email, btInvoiceAmount, true);
}
return false;
}