mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-20 02:28:31 +01:00
cf206e64a7
* Add Lightning payout support * Adjust Greenfield API to allow other payment types for Payouts * Pull payment view: Improve payment method select * Pull payments view: Update JS * Pull payments view: Table improvements * Pull payment form: Remove duplicate name field * Cleanup Lightning branch after rebasing * Update swagger documnetation for Lightning support * Remove required requirement for amount in pull payments * Adapt Refund endpoint to support multiple playment methods * Support LNURL Pay for Pull Payments * Revert "Remove required requirement for amount in pull payments" This reverts commit 96cb78939d43b7be61ee2d257800ccd1cce45c4c. * Support Lightning address payout claims * Fix lightning claim handling and provide better error messages * Fix tests Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
22 lines
680 B
C#
22 lines
680 B
C#
using System;
|
|
using System.Linq.Expressions;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.AspNetCore.Mvc.ViewFeatures;
|
|
|
|
namespace BTCPayServer
|
|
{
|
|
public static class ModelStateExtensions
|
|
{
|
|
|
|
public static void AddModelError<TModel, TProperty>(this TModel source,
|
|
Expression<Func<TModel, TProperty>> ex,
|
|
string message,
|
|
ControllerBase controller)
|
|
{
|
|
var provider = (ModelExpressionProvider)controller.HttpContext.RequestServices.GetService(typeof(ModelExpressionProvider));
|
|
var key = provider.GetExpressionText(ex);
|
|
controller.ModelState.AddModelError(key, message);
|
|
}
|
|
}
|
|
}
|