1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-22 12:15:36 +01:00

check if already paid

This commit is contained in:
Kyle Spearrin 2019-06-17 08:19:26 -04:00
parent 377e6ff697
commit e242539b84

View File

@ -345,7 +345,7 @@ namespace Bit.Billing.Controllers
throw new Exception("Invoice is null. " + parsedEvent.Id);
}
if(invoice.AttemptCount > 1 && UnpaidAutoChargeInvoiceForSubscriptionCycle(invoice))
if(!invoice.Paid && invoice.AttemptCount > 1 && UnpaidAutoChargeInvoiceForSubscriptionCycle(invoice))
{
await AttemptToPayInvoiceWithBraintreeAsync(invoice);
}
@ -357,7 +357,7 @@ namespace Bit.Billing.Controllers
throw new Exception("Invoice is null. " + parsedEvent.Id);
}
if(UnpaidAutoChargeInvoiceForSubscriptionCycle(invoice))
if(!invoice.Paid && UnpaidAutoChargeInvoiceForSubscriptionCycle(invoice))
{
await AttemptToPayInvoiceWithBraintreeAsync(invoice);
}