mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 06:24:24 +01:00
Rewording: Integrations become (store) plugins
We're keeping the `store-integrations-list` extension point name for backwards compatibility, otherwise I renamed all "integration" occurences in the views and also the routes. Note: We still refer to external software like WooCommerce, Drupal, Magento and such as "integrations", I think that distinction makes sense. Closes #3594.
This commit is contained in:
committed by
Andrew Camilleri
parent
f1029fceff
commit
2ae4501de6
@@ -35,7 +35,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a asp-area="" asp-controller="UIStores" asp-action="GeneralSettings" asp-route-storeId="@Model.Store.Id" class="nav-link js-scroll-trigger @ViewData.IsActivePage(StoreNavPages.Rates) @ViewData.IsActivePage(StoreNavPages.CheckoutAppearance) @ViewData.IsActivePage(StoreNavPages.General) @ViewData.IsActivePage(StoreNavPages.Tokens) @ViewData.IsActivePage(StoreNavPages.Users) @ViewData.IsActivePage(StoreNavPages.Integrations) @ViewData.IsActivePage(StoreNavPages.Webhooks)" id="StoreNav-StoreSettings">
|
<a asp-area="" asp-controller="UIStores" asp-action="GeneralSettings" asp-route-storeId="@Model.Store.Id" class="nav-link js-scroll-trigger @ViewData.IsActivePage(StoreNavPages.Rates) @ViewData.IsActivePage(StoreNavPages.CheckoutAppearance) @ViewData.IsActivePage(StoreNavPages.General) @ViewData.IsActivePage(StoreNavPages.Tokens) @ViewData.IsActivePage(StoreNavPages.Users) @ViewData.IsActivePage(StoreNavPages.Plugins) @ViewData.IsActivePage(StoreNavPages.Webhooks)" id="StoreNav-StoreSettings">
|
||||||
<vc:icon symbol="settings"/>
|
<vc:icon symbol="settings"/>
|
||||||
<span>Settings</span>
|
<span>Settings</span>
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -474,7 +474,7 @@ namespace BTCPayServer
|
|||||||
|
|
||||||
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Cookie)]
|
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Cookie)]
|
||||||
[Authorize(Policy = Policies.CanModifyStoreSettings, AuthenticationSchemes = AuthenticationSchemes.Cookie)]
|
[Authorize(Policy = Policies.CanModifyStoreSettings, AuthenticationSchemes = AuthenticationSchemes.Cookie)]
|
||||||
[HttpGet("~/stores/{storeId}/integrations/lightning-address")]
|
[HttpGet("~/stores/{storeId}/plugins/lightning-address")]
|
||||||
public async Task<IActionResult> EditLightningAddress(string storeId)
|
public async Task<IActionResult> EditLightningAddress(string storeId)
|
||||||
{
|
{
|
||||||
if (ControllerContext.HttpContext.GetStoreData().GetEnabledPaymentIds(_btcPayNetworkProvider)
|
if (ControllerContext.HttpContext.GetStoreData().GetEnabledPaymentIds(_btcPayNetworkProvider)
|
||||||
@@ -512,7 +512,7 @@ namespace BTCPayServer
|
|||||||
|
|
||||||
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Cookie)]
|
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Cookie)]
|
||||||
[Authorize(Policy = Policies.CanModifyStoreSettings, AuthenticationSchemes = AuthenticationSchemes.Cookie)]
|
[Authorize(Policy = Policies.CanModifyStoreSettings, AuthenticationSchemes = AuthenticationSchemes.Cookie)]
|
||||||
[HttpPost("~/stores/{storeId}/integrations/lightning-address")]
|
[HttpPost("~/stores/{storeId}/plugins/lightning-address")]
|
||||||
public async Task<IActionResult> EditLightningAddress(string storeId, [FromForm] EditLightningAddressVM vm,
|
public async Task<IActionResult> EditLightningAddress(string storeId, [FromForm] EditLightningAddressVM vm,
|
||||||
string command, [FromServices] CurrencyNameTable currencyNameTable)
|
string command, [FromServices] CurrencyNameTable currencyNameTable)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -15,10 +15,10 @@ namespace BTCPayServer.Controllers
|
|||||||
{
|
{
|
||||||
public partial class UIStoresController
|
public partial class UIStoresController
|
||||||
{
|
{
|
||||||
[HttpGet("{storeId}/integrations")]
|
[HttpGet("{storeId}/plugins")]
|
||||||
public IActionResult Integrations()
|
public IActionResult Plugins()
|
||||||
{
|
{
|
||||||
return View("Integrations", new IntegrationsViewModel());
|
return View("Plugins", new PluginsViewModel());
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<Data.WebhookDeliveryData?> LastDeliveryForWebhook(string webhookId)
|
private async Task<Data.WebhookDeliveryData?> LastDeliveryForWebhook(string webhookId)
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using static BTCPayServer.Data.StoreBlob;
|
|
||||||
|
|
||||||
namespace BTCPayServer.Models.StoreViewModels
|
|
||||||
{
|
|
||||||
public class IntegrationsViewModel
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
6
BTCPayServer/Models/StoreViewModels/PluginsViewModel.cs
Normal file
6
BTCPayServer/Models/StoreViewModels/PluginsViewModel.cs
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
namespace BTCPayServer.Models.StoreViewModels
|
||||||
|
{
|
||||||
|
public class PluginsViewModel
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -94,7 +94,7 @@ namespace BTCPayServer.Plugins.Shopify
|
|||||||
}
|
}
|
||||||
|
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
[HttpGet("stores/{storeId}/integrations/shopify/shopify.js")]
|
[HttpGet("stores/{storeId}/plugins/shopify/shopify.js")]
|
||||||
public async Task<IActionResult> ShopifyJavascript(string storeId)
|
public async Task<IActionResult> ShopifyJavascript(string storeId)
|
||||||
{
|
{
|
||||||
var jsFile =
|
var jsFile =
|
||||||
@@ -105,7 +105,7 @@ namespace BTCPayServer.Plugins.Shopify
|
|||||||
[RateLimitsFilter(ZoneLimits.Shopify, Scope = RateLimitsScope.RemoteAddress)]
|
[RateLimitsFilter(ZoneLimits.Shopify, Scope = RateLimitsScope.RemoteAddress)]
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
[EnableCors(CorsPolicies.All)]
|
[EnableCors(CorsPolicies.All)]
|
||||||
[HttpGet("stores/{storeId}/integrations/shopify/{orderId}")]
|
[HttpGet("stores/{storeId}/plugins/shopify/{orderId}")]
|
||||||
public async Task<IActionResult> ShopifyInvoiceEndpoint(
|
public async Task<IActionResult> ShopifyInvoiceEndpoint(
|
||||||
string storeId, string orderId, decimal amount, bool checkOnly = false)
|
string storeId, string orderId, decimal amount, bool checkOnly = false)
|
||||||
{
|
{
|
||||||
@@ -202,8 +202,8 @@ namespace BTCPayServer.Plugins.Shopify
|
|||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("stores/{storeId}/integrations/shopify")]
|
[Route("stores/{storeId}/plugins/shopify")]
|
||||||
public IActionResult EditShopifyIntegration()
|
public IActionResult EditShopify()
|
||||||
{
|
{
|
||||||
var blob = CurrentStore.GetStoreBlob();
|
var blob = CurrentStore.GetStoreBlob();
|
||||||
|
|
||||||
@@ -211,8 +211,8 @@ namespace BTCPayServer.Plugins.Shopify
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[HttpPost("stores/{storeId}/integrations/shopify")]
|
[HttpPost("stores/{storeId}/plugins/shopify")]
|
||||||
public async Task<IActionResult> EditShopifyIntegration(string storeId,
|
public async Task<IActionResult> EditShopify(string storeId,
|
||||||
ShopifySettings vm, string command = "")
|
ShopifySettings vm, string command = "")
|
||||||
{
|
{
|
||||||
switch (command)
|
switch (command)
|
||||||
@@ -257,7 +257,7 @@ namespace BTCPayServer.Plugins.Shopify
|
|||||||
await _storeRepository.UpdateStore(CurrentStore);
|
await _storeRepository.UpdateStore(CurrentStore);
|
||||||
}
|
}
|
||||||
|
|
||||||
TempData[WellKnownTempData.SuccessMessage] = "Shopify integration successfully updated";
|
TempData[WellKnownTempData.SuccessMessage] = "Shopify plugin successfully updated";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "ShopifyClearCredentials":
|
case "ShopifyClearCredentials":
|
||||||
@@ -269,12 +269,12 @@ namespace BTCPayServer.Plugins.Shopify
|
|||||||
await _storeRepository.UpdateStore(CurrentStore);
|
await _storeRepository.UpdateStore(CurrentStore);
|
||||||
}
|
}
|
||||||
|
|
||||||
TempData[WellKnownTempData.SuccessMessage] = "Shopify integration credentials cleared";
|
TempData[WellKnownTempData.SuccessMessage] = "Shopify plugin credentials cleared";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return RedirectToAction(nameof(EditShopifyIntegration), new { storeId = CurrentStore.Id });
|
return RedirectToAction(nameof(EditShopify), new { storeId = CurrentStore.Id });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
Enabled
|
Enabled
|
||||||
</span>
|
</span>
|
||||||
<span class="text-light ms-3 me-2">|</span>
|
<span class="text-light ms-3 me-2">|</span>
|
||||||
<a lass="btn btn-link px-1 py-1 fw-semibold" asp-controller="UIShopify" asp-action="EditShopifyIntegration" asp-route-storeId="@Context.GetRouteValue("storeId")">
|
<a lass="btn btn-link px-1 py-1 fw-semibold" asp-controller="UIShopify" asp-action="EditShopify" asp-route-storeId="@Context.GetRouteValue("storeId")">
|
||||||
Modify
|
Modify
|
||||||
</a>
|
</a>
|
||||||
}
|
}
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
<span class="me-2 btcpay-status btcpay-status--disabled"></span>
|
<span class="me-2 btcpay-status btcpay-status--disabled"></span>
|
||||||
Disabled
|
Disabled
|
||||||
</span>
|
</span>
|
||||||
<a class="btn btn-primary btn-sm ms-4 px-3 py-1 fw-semibold" asp-controller="UIShopify" asp-action="EditShopifyIntegration" asp-route-storeId="@Context.GetRouteValue("storeId")">
|
<a class="btn btn-primary btn-sm ms-4 px-3 py-1 fw-semibold" asp-controller="UIShopify" asp-action="EditShopify" asp-route-storeId="@Context.GetRouteValue("storeId")">
|
||||||
Setup
|
Setup
|
||||||
</a>
|
</a>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a asp-area="" asp-controller="UIShopify" asp-action="EditShopifyIntegration" asp-route-storeId="@store.Id" class="nav-link js-scroll-trigger @ViewData.IsActivePage("shopify", nameof(StoreNavPages))" id="StoreNav-Shopify">
|
<a asp-area="" asp-controller="UIShopify" asp-action="EditShopify" asp-route-storeId="@store.Id" class="nav-link js-scroll-trigger @ViewData.IsActivePage("shopify", nameof(StoreNavPages))" id="StoreNav-Shopify">
|
||||||
<vc:icon symbol="shopify"/>
|
<vc:icon symbol="shopify"/>
|
||||||
<span>Shopify</span>
|
<span>Shopify</span>
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
@model IntegrationsViewModel
|
@model PluginsViewModel
|
||||||
@{
|
@{
|
||||||
Layout = "../Shared/_NavLayout.cshtml";
|
Layout = "../Shared/_NavLayout.cshtml";
|
||||||
ViewData.SetActivePage(StoreNavPages.Integrations, "Integrations", Context.GetStoreData().Id);
|
ViewData.SetActivePage(StoreNavPages.Plugins, "Plugins", Context.GetStoreData().Id);
|
||||||
}
|
}
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@@ -16,8 +16,8 @@
|
|||||||
<vc:ui-extension-point location="store-integrations-list" model="@Model" />
|
<vc:ui-extension-point location="store-integrations-list" model="@Model" />
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h3 class="mt-5 mb-3">Other Integrations</h3>
|
<h3 class="mt-5 mb-3">Integrations</h3>
|
||||||
<p>Take a look at documentation for the list of other integrations we support and the directions on how to enable them:</p>
|
<p>Take a look at documentation for the list of integrations we support and the directions on how to enable them:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="https://docs.btcpayserver.org/WooCommerce/" target="_blank" rel="noreferrer noopener">WooCommerce</a></li>
|
<li><a href="https://docs.btcpayserver.org/WooCommerce/" target="_blank" rel="noreferrer noopener">WooCommerce</a></li>
|
||||||
<li><a href="https://docs.btcpayserver.org/Drupal/" target="_blank" rel="noreferrer noopener">Drupal</a></li>
|
<li><a href="https://docs.btcpayserver.org/Drupal/" target="_blank" rel="noreferrer noopener">Drupal</a></li>
|
||||||
@@ -2,6 +2,6 @@ namespace BTCPayServer.Views.Stores
|
|||||||
{
|
{
|
||||||
public enum StoreNavPages
|
public enum StoreNavPages
|
||||||
{
|
{
|
||||||
Create, Dashboard, General, Rates, OnchainSettings, LightningSettings, Lightning, CheckoutAppearance, Tokens, Users, PayButton, Integrations, Webhooks, PullPayments, Payouts
|
Create, Dashboard, General, Rates, OnchainSettings, LightningSettings, Lightning, CheckoutAppearance, Tokens, Users, PayButton, Plugins, Webhooks, PullPayments, Payouts
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<a permission="@Policies.CanModifyStoreSettings" id="SectionNav-@(nameof(StoreNavPages.CheckoutAppearance))" class="nav-link @ViewData.IsActivePage(StoreNavPages.CheckoutAppearance)" asp-controller="UIStores" asp-action="CheckoutAppearance" asp-route-storeId="@storeId">Checkout Appearance</a>
|
<a permission="@Policies.CanModifyStoreSettings" id="SectionNav-@(nameof(StoreNavPages.CheckoutAppearance))" class="nav-link @ViewData.IsActivePage(StoreNavPages.CheckoutAppearance)" asp-controller="UIStores" asp-action="CheckoutAppearance" asp-route-storeId="@storeId">Checkout Appearance</a>
|
||||||
<a permission="@Policies.CanModifyStoreSettings" id="SectionNav-@(nameof(StoreNavPages.Tokens))" class="nav-link @ViewData.IsActivePage(StoreNavPages.Tokens)" asp-controller="UIStores" asp-action="ListTokens" asp-route-storeId="@storeId">Access Tokens</a>
|
<a permission="@Policies.CanModifyStoreSettings" id="SectionNav-@(nameof(StoreNavPages.Tokens))" class="nav-link @ViewData.IsActivePage(StoreNavPages.Tokens)" asp-controller="UIStores" asp-action="ListTokens" asp-route-storeId="@storeId">Access Tokens</a>
|
||||||
<a permission="@Policies.CanModifyStoreSettings" id="SectionNav-@(nameof(StoreNavPages.Users))" class="nav-link @ViewData.IsActivePage(StoreNavPages.Users)" asp-controller="UIStores" asp-action="StoreUsers" asp-route-storeId="@storeId">Users</a>
|
<a permission="@Policies.CanModifyStoreSettings" id="SectionNav-@(nameof(StoreNavPages.Users))" class="nav-link @ViewData.IsActivePage(StoreNavPages.Users)" asp-controller="UIStores" asp-action="StoreUsers" asp-route-storeId="@storeId">Users</a>
|
||||||
<a permission="@Policies.CanModifyStoreSettings" id="SectionNav-@(nameof(StoreNavPages.Integrations))" class="nav-link @ViewData.IsActivePage(StoreNavPages.Integrations)" asp-controller="UIStores" asp-action="Integrations" asp-route-storeId="@storeId">Integrations</a>
|
<a permission="@Policies.CanModifyStoreSettings" id="SectionNav-@(nameof(StoreNavPages.Plugins))" class="nav-link @ViewData.IsActivePage(StoreNavPages.Plugins)" asp-controller="UIStores" asp-action="Plugins" asp-route-storeId="@storeId">Plugins</a>
|
||||||
<a permission="@Policies.CanModifyStoreSettings" id="SectionNav-@(nameof(StoreNavPages.Webhooks))" class="nav-link @ViewData.IsActivePage(StoreNavPages.Webhooks)" asp-controller="UIStores" asp-action="Webhooks" asp-route-storeId="@storeId">Webhooks</a>
|
<a permission="@Policies.CanModifyStoreSettings" id="SectionNav-@(nameof(StoreNavPages.Webhooks))" class="nav-link @ViewData.IsActivePage(StoreNavPages.Webhooks)" asp-controller="UIStores" asp-action="Webhooks" asp-route-storeId="@storeId">Webhooks</a>
|
||||||
<a permission="@Policies.CanModifyStoreSettings" id="SectionNav-PayoutProcessors" class="nav-link @ViewData.IsActivePage("PayoutProcessors")" asp-controller="UIPayoutProcessors" asp-action="ConfigureStorePayoutProcessors" asp-route-storeId="@storeId">Payout Processors</a>
|
<a permission="@Policies.CanModifyStoreSettings" id="SectionNav-PayoutProcessors" class="nav-link @ViewData.IsActivePage("PayoutProcessors")" asp-controller="UIPayoutProcessors" asp-action="ConfigureStorePayoutProcessors" asp-route-storeId="@storeId">Payout Processors</a>
|
||||||
<vc:ui-extension-point location="store-nav" model="@Model"/>
|
<vc:ui-extension-point location="store-nav" model="@Model"/>
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ window.BTCPayShopifyIntegrationModule = function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getOrCheckInvoice(backgroundCheck) {
|
function getOrCheckInvoice(backgroundCheck) {
|
||||||
const url = btcPayServerUrl + "/stores/" + storeId + "/integrations/shopify/" + shopify_order_id+"?amount="+Shopify.checkout.payment_due+ (backgroundCheck ? "&checkonly=true" : "");
|
const url = btcPayServerUrl + "/stores/" + storeId + "/plugins/shopify/" + shopify_order_id+"?amount="+Shopify.checkout.payment_due+ (backgroundCheck ? "&checkonly=true" : "");
|
||||||
return fetch(url, {
|
return fetch(url, {
|
||||||
method: "GET",
|
method: "GET",
|
||||||
mode: "cors", // no-cors, cors, *same-origin,
|
mode: "cors", // no-cors, cors, *same-origin,
|
||||||
|
|||||||
Reference in New Issue
Block a user