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:
Andrew Camilleri
2022-11-15 10:40:57 +01:00
committed by GitHub
parent 17f3b4125b
commit 2d23819944
16 changed files with 500 additions and 91 deletions

View File

@@ -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
{