mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-22 06:21:44 +01:00
Disabling automatic creation of Script in Shopify
This commit is contained in:
parent
0812596929
commit
c14fd69a0e
2 changed files with 15 additions and 14 deletions
|
@ -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;
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
</h4>
|
||||
@if (!shopifyCredsSet)
|
||||
{
|
||||
<p class="alert alert-info">Create a Shopify Private App with the permissions "Script tags - Read and write" and "Orders - Read and write"</p>
|
||||
<p class="alert alert-info">Create a Shopify Private App with the permissions "Orders - Read and write"</p>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="exampleUrl">Example Url from Shopify Private App</label>
|
||||
|
|
Loading…
Add table
Reference in a new issue