mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 22:14:26 +01:00
Fix: Do not allow retry of payouts if they are non interactive (Boltcard) (#6382)
This commit is contained in:
@@ -192,6 +192,7 @@ namespace BTCPayServer
|
||||
PayoutMethodId = pmi,
|
||||
PullPaymentId = pullPaymentId,
|
||||
StoreId = pp.StoreId,
|
||||
NonInteractiveOnly = nonInteractiveOnly,
|
||||
ClaimedAmount = result.MinimumAmount.ToDecimal(unit),
|
||||
});
|
||||
|
||||
|
||||
@@ -27,7 +27,8 @@ namespace BTCPayServer.Data
|
||||
|
||||
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
public int? ErrorCount { get; set; }
|
||||
|
||||
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
public bool NonInteractiveOnly { get; set; }
|
||||
public int IncrementErrorCount()
|
||||
{
|
||||
if (ErrorCount is { } c)
|
||||
|
||||
@@ -709,11 +709,12 @@ namespace BTCPayServer.HostedServices
|
||||
DedupId = req.ClaimRequest.Destination.Id,
|
||||
StoreDataId = req.ClaimRequest.StoreId ?? pp?.StoreId,
|
||||
Currency = payoutHandler.Currency,
|
||||
OriginalCurrency = pp?.Currency ?? payoutHandler.Currency
|
||||
OriginalCurrency = pp?.Currency ?? payoutHandler.Currency,
|
||||
};
|
||||
var payoutBlob = new PayoutBlob()
|
||||
{
|
||||
Destination = req.ClaimRequest.Destination.ToString(),
|
||||
NonInteractiveOnly = req.ClaimRequest.NonInteractiveOnly,
|
||||
Metadata = req.ClaimRequest.Metadata ?? new JObject(),
|
||||
};
|
||||
payout.OriginalAmount = claimed;
|
||||
@@ -1067,6 +1068,7 @@ namespace BTCPayServer.HostedServices
|
||||
public IClaimDestination Destination { get; set; }
|
||||
public string StoreId { get; set; }
|
||||
public bool? PreApprove { get; set; }
|
||||
public bool NonInteractiveOnly { get; set; }
|
||||
public JObject Metadata { get; set; }
|
||||
}
|
||||
|
||||
|
||||
@@ -117,6 +117,9 @@ public class LightningAutomatedPayoutProcessor : BaseAutomatedPayoutProcessor<Li
|
||||
break;
|
||||
}
|
||||
|
||||
if (result.Success is false && blob.NonInteractiveOnly)
|
||||
payoutData.State = PayoutState.Cancelled;
|
||||
|
||||
bool updateBlob = false;
|
||||
if (result.Success is false && payoutData.State == PayoutState.AwaitingPayment)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user