From 41f9f6a7f08fb42422cc15af2b87fccf447a8081 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Mon, 12 Aug 2019 10:33:06 -0400 Subject: [PATCH] only refund captured charges --- src/Core/Services/Implementations/StripePaymentService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Core/Services/Implementations/StripePaymentService.cs b/src/Core/Services/Implementations/StripePaymentService.cs index 7223e79ce4..8baf941025 100644 --- a/src/Core/Services/Implementations/StripePaymentService.cs +++ b/src/Core/Services/Implementations/StripePaymentService.cs @@ -742,7 +742,7 @@ namespace Bit.Core.Services if(charges?.Data != null) { var refundService = new RefundService(); - foreach(var charge in charges.Data.Where(c => !c.Refunded)) + foreach(var charge in charges.Data.Where(c => c.Captured.GetValueOrDefault() && !c.Refunded)) { await refundService.CreateAsync(new RefundCreateOptions { ChargeId = charge.Id }); }