From c14fd69a0ee7a7677e9290c37de5291a05e80464 Mon Sep 17 00:00:00 2001 From: rockstardev Date: Sat, 26 Sep 2020 12:51:29 -0500 Subject: [PATCH] Disabling automatic creation of Script in Shopify --- .../StoresController.Integrations.cs | 27 ++++++++++--------- .../Views/Stores/Integrations/Shopify.cshtml | 2 +- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/BTCPayServer/Controllers/StoresController.Integrations.cs b/BTCPayServer/Controllers/StoresController.Integrations.cs index cdeb377f8..8e8527d01 100644 --- a/BTCPayServer/Controllers/StoresController.Integrations.cs +++ b/BTCPayServer/Controllers/StoresController.Integrations.cs @@ -192,25 +192,26 @@ namespace BTCPayServer.Controllers } var scopesGranted = await apiClient.CheckScopes(); - if (!scopesGranted.Contains("read_orders") || !scopesGranted.Contains("write_script_tags")) + if (!scopesGranted.Contains("read_orders") || !scopesGranted.Contains("write_orders")) { TempData[WellKnownTempData.ErrorMessage] = - "Please grant the private app permissions for read_orders, write_script_tags"; + "Please grant the private app permissions for read_orders, write_orders"; return View("Integrations", vm); } - try - { - var result = await apiClient.CreateScript(Url.Action("ShopifyJavascript", "Stores", - new { storeId = CurrentStore.Id }, Request.Scheme)); + // Not automatically registering scripts + //try + //{ + // var result = await apiClient.CreateScript(Url.Action("ShopifyJavascript", "Stores", + // new { storeId = CurrentStore.Id }, Request.Scheme)); - shopify.ScriptId = result.ScriptTag?.Id.ToString(CultureInfo.InvariantCulture); - } - catch - { - // ignore errors, signify ScriptId needs to be set manually - shopify.ScriptId = null; - } + // shopify.ScriptId = result.ScriptTag?.Id.ToString(CultureInfo.InvariantCulture); + //} + //catch + //{ + // // ignore errors, signify ScriptId needs to be set manually + // shopify.ScriptId = null; + //} // everything ready, proceed with saving Shopify integration credentials shopify.IntegratedAt = DateTimeOffset.Now; diff --git a/BTCPayServer/Views/Stores/Integrations/Shopify.cshtml b/BTCPayServer/Views/Stores/Integrations/Shopify.cshtml index 6b0a54b39..f67eeb545 100644 --- a/BTCPayServer/Views/Stores/Integrations/Shopify.cshtml +++ b/BTCPayServer/Views/Stores/Integrations/Shopify.cshtml @@ -12,7 +12,7 @@ @if (!shopifyCredsSet) { -

Create a Shopify Private App with the permissions "Script tags - Read and write" and "Orders - Read and write"

+

Create a Shopify Private App with the permissions "Orders - Read and write"