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