@using BTCPayServer.Client.Models @using BTCPayServer.Payments @using BTCPayServer.Views.Stores @using BTCPayServer.Abstractions.Extensions @using BTCPayServer.Client @using BTCPayServer.PayoutProcessors @model BTCPayServer.Models.WalletViewModels.PayoutsModel @inject IEnumerable PayoutHandlers; @inject PayoutProcessorService _payoutProcessorService; @inject IEnumerable _payoutProcessorFactories; @{ var storeId = Context.GetRouteValue("storeId") as string; ViewData.SetActivePage(StoreNavPages.Payouts, $"Payouts{(string.IsNullOrEmpty(Model.PullPaymentName) ? string.Empty : " for pull payment " + Model.PullPaymentName)}", Context.GetStoreData().Id); Model.PaginationQuery ??= new Dictionary(); Model.PaginationQuery.Add("pullPaymentId", Model.PullPaymentId); Model.PaginationQuery.Add("paymentMethodId", Model.PaymentMethodId); Model.PaginationQuery.Add("payoutState", Model.PayoutState); var stateActions = new List<(string Action, string Text)>(); if (PaymentMethodId.TryParse(Model.PaymentMethodId, out var paymentMethodId)) { var payoutHandler = PayoutHandlers.FindPayoutHandler(paymentMethodId); if (payoutHandler is null) return; stateActions.AddRange(payoutHandler.GetPayoutSpecificActions().Where(pair => pair.Key == Model.PayoutState).SelectMany(pair => pair.Value)); } switch (Model.PayoutState) { case PayoutState.AwaitingApproval: stateActions.Add(("approve", "Approve selected payouts")); stateActions.Add(("approve-pay", "Approve & Send selected payouts")); stateActions.Add(("cancel", "Cancel selected payouts")); break; case PayoutState.AwaitingPayment: stateActions.Add(("pay", "Send selected payouts")); stateActions.Add(("cancel", "Cancel selected payouts")); stateActions.Add(("mark-paid", "Mark selected payouts as already paid")); break; } } @section PageHeadContent { } @section PageFootContent { }

Payouts allow you to process pull payments, in the form of refunds, salary payouts, or withdrawals. You can also configure payout processors to automate payouts.

Learn More
@if (_payoutProcessorFactories.Any(factory => factory.GetSupportedPaymentMethods().Contains(paymentMethodId)) && !(await _payoutProcessorService.GetProcessors(new PayoutProcessorService.PayoutProcessorQuery() { Stores = new[] { storeId }, PaymentMethods = new[] { Model.PaymentMethodId } })).Any()) { }
@if (Model.Payouts.Any() && stateActions.Any()) { }
@if (Model.Payouts.Any()) {
@if (Model.PayoutState != PayoutState.AwaitingApproval) { } @for (int i = 0; i < Model.Payouts.Count; i++) { var pp = Model.Payouts[i]; @if (Model.PayoutState != PayoutState.AwaitingApproval) { } }
Date Source Destination AmountTransaction
@pp.Date.ToBrowserDate() @pp.PullPaymentName @pp.Destination @pp.Amount @if (!(pp.ProofLink is null)) { Link }
} else {

There are no payouts matching this criteria.

}