From e242539b84c0d121a9d59c661301c8f6d614b10c Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Mon, 17 Jun 2019 08:19:26 -0400 Subject: [PATCH] check if already paid --- src/Billing/Controllers/StripeController.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Billing/Controllers/StripeController.cs b/src/Billing/Controllers/StripeController.cs index b7012f8e7..9d396e0c6 100644 --- a/src/Billing/Controllers/StripeController.cs +++ b/src/Billing/Controllers/StripeController.cs @@ -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); }