Plugins: Allow payout processors to signal they cannot be removed through common UI

This commit is contained in:
Kukks
2023-05-15 09:49:01 +02:00
parent 25fb5c1293
commit 8db5e7e043
2 changed files with 7 additions and 2 deletions

View File

@@ -14,4 +14,5 @@ public interface IPayoutProcessorFactory
public string ConfigureLink(string storeId, PaymentMethodId paymentMethodId, HttpRequest request);
public IEnumerable<PaymentMethodId> GetSupportedPaymentMethods();
public Task<IHostedService> ConstructProcessor(PayoutProcessorData settings);
public Task<bool> CanRemove() => Task.FromResult(true);
}

View File

@@ -43,8 +43,12 @@
else
{
<a href="@processorsView.Factory.ConfigureLink(storeId, conf.Key, Context.Request)">Modify</a>
<span>-</span>
<a asp-action="Remove" asp-route-storeId="@storeId" asp-route-id="@conf.Value.Id" data-bs-toggle="modal" data-bs-target="#ConfirmModal" data-description="The @Html.Encode(processorsView.Factory.FriendlyName) for @Html.Encode(conf.Key.CryptoCode) will be removed from your store.">Remove</a>
@if (await processorsView.Factory.CanRemove())
{
<span>-</span>
<a asp-action="Remove" asp-route-storeId="@storeId" asp-route-id="@conf.Value.Id" data-bs-toggle="modal" data-bs-target="#ConfirmModal" data-description="The @Html.Encode(processorsView.Factory.FriendlyName) for @Html.Encode(conf.Key.CryptoCode) will be removed from your store.">Remove</a>
}
}
</td>
</tr>