Introduce Payout metadata for api and plugins (#5182)

* Introduce Payout metadata for api and plugins

* fix controller

* fix metadata requirement

* save an object

* pr changes
This commit is contained in:
Andrew Camilleri
2023-07-24 11:37:18 +02:00
committed by GitHub
parent dc986959fd
commit 36ea17a6b7
11 changed files with 120 additions and 9 deletions

View File

@@ -19,6 +19,7 @@ using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Routing;
using Microsoft.EntityFrameworkCore;
using Newtonsoft.Json.Linq;
using MarkPayoutRequest = BTCPayServer.HostedServices.MarkPayoutRequest;
namespace BTCPayServer.Controllers.Greenfield
@@ -284,7 +285,8 @@ namespace BTCPayServer.Controllers.Greenfield
Amount = blob.Amount,
PaymentMethodAmount = blob.CryptoAmount,
Revision = blob.Revision,
State = p.State
State = p.State,
Metadata = blob.Metadata?? new JObject(),
};
model.Destination = blob.Destination;
model.PaymentMethod = p.PaymentMethodId;
@@ -341,7 +343,7 @@ namespace BTCPayServer.Controllers.Greenfield
Destination = destination.destination,
PullPaymentId = pullPaymentId,
Value = request.Amount,
PaymentMethodId = paymentMethodId,
PaymentMethodId = paymentMethodId
});
return HandleClaimResult(result);
@@ -415,7 +417,8 @@ namespace BTCPayServer.Controllers.Greenfield
PreApprove = request.Approved,
Value = request.Amount,
PaymentMethodId = paymentMethodId,
StoreId = storeId
StoreId = storeId,
Metadata = request.Metadata
});
return HandleClaimResult(result);
}