mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 14:04:26 +01:00
Greenfield: Allow marking payout status and payment proofs (#4244)
This allows external services to integrate with the payouts system to process payouts. This is also a step to allow plugins to provide payout processors. * It provides the payment proof through the greenfield payoust api. * It allows you to set the state of a payout outside of the usual flow: * When state is awaiting payment, allow setting to In progess or completed * When state is in progress, allow setting back to awaiting payment
This commit is contained in:
@@ -31,6 +31,7 @@ using Microsoft.AspNetCore.Routing;
|
||||
using NBitcoin;
|
||||
using NBitcoin.Crypto;
|
||||
using Newtonsoft.Json;
|
||||
using MarkPayoutRequest = BTCPayServer.HostedServices.MarkPayoutRequest;
|
||||
|
||||
namespace BTCPayServer
|
||||
{
|
||||
@@ -167,9 +168,9 @@ namespace BTCPayServer
|
||||
switch (payResult.Result)
|
||||
{
|
||||
case PayResult.Ok:
|
||||
await _pullPaymentHostedService.MarkPaid(new PayoutPaidRequest()
|
||||
await _pullPaymentHostedService.MarkPaid(new MarkPayoutRequest()
|
||||
{
|
||||
PayoutId = claimResponse.PayoutData.Id, Proof = new ManualPayoutProof { }
|
||||
PayoutId = claimResponse.PayoutData.Id, State = PayoutState.Completed
|
||||
});
|
||||
|
||||
return Ok(new LNUrlStatusResponse {Status = "OK"});
|
||||
@@ -178,7 +179,7 @@ namespace BTCPayServer
|
||||
new PullPaymentHostedService.CancelRequest(new string[]
|
||||
{
|
||||
claimResponse.PayoutData.Id
|
||||
}));
|
||||
}, null));
|
||||
|
||||
return Ok(new LNUrlStatusResponse
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user