Fix: Refunds through API were ignoring BOLT11 expiration at store level (#6644)

This commit is contained in:
Nicolas Dorier
2025-03-31 09:32:12 +09:00
committed by GitHub
parent c5270fa441
commit 658ddd1f27
11 changed files with 78 additions and 60 deletions

View File

@@ -376,13 +376,11 @@ namespace BTCPayServer.Controllers.Greenfield
cancellationToken
);
var paidAmount = cryptoPaid.RoundToSignificant(paymentPrompt.Divisibility);
var createPullPayment = new CreatePullPayment
var createPullPayment = new CreatePullPaymentRequest
{
BOLT11Expiration = store.GetStoreBlob().RefundBOLT11Expiration,
Name = request.Name ?? $"Refund {invoice.Id}",
Description = request.Description,
StoreId = storeId,
PayoutMethods = new[] { payoutMethodId },
PayoutMethods = new[] { payoutMethodId.ToString() },
};
if (request.RefundVariant != RefundVariant.Custom)
@@ -479,8 +477,8 @@ namespace BTCPayServer.Controllers.Greenfield
createPullPayment.Amount = Math.Round(createPullPayment.Amount - reduceByAmount, appliedDivisibility);
}
createPullPayment.AutoApproveClaims = createPullPayment.AutoApproveClaims && (await _authorizationService.AuthorizeAsync(User, createPullPayment.StoreId ,Policies.CanCreatePullPayments)).Succeeded;
var ppId = await _pullPaymentService.CreatePullPayment(createPullPayment);
createPullPayment.AutoApproveClaims = createPullPayment.AutoApproveClaims && (await _authorizationService.AuthorizeAsync(User, storeId ,Policies.CanCreatePullPayments)).Succeeded;
var ppId = await _pullPaymentService.CreatePullPayment(store, createPullPayment);
await using var ctx = _dbContextFactory.CreateContext();