btcpayserver/BTCPayServer/Views/Shopify/EditShopifyIntegration.cshtml
d11n e2d0b7c5f7
Store centric UI: Part 3 (#3224)
* Set store context in cookie

* Fix page id usages in view

* Move Pay Button to nav

* Move integrations to plugins nav

* Store switch links to wallet if present

* Test fixes

* Nav fixes

* Fix altcoin view

* Main nav updates

* Wallet setttings nav update

* Move storeId cookie fallback to cookie auth handler

* View fixes

* Test fixes

* Fix profile check

* Rename integrations nav extension point to store-integrations-nav-list

* Allow strings for Active page/category for plugins

* Make invoice list filter based on store context

* Do not set context if we are running authorizer through tag helper

* Fix test and unfiltered invoices

* Add permission helper for wallet links

* Add sanity checks for payment requests and invoices

* Store context in home controller

* Fix PayjoinViaUI test

* Store context for notifications

* Minor UI improvements

* Store context for userstores and vault controller

* Bring back integrations page

* Rename notifications nav pages file

* Fix user stores controller policies

* Controller policy fixes from code review

* CookieAuthHandler: Simplify CanViewInvoices case

* Revert "Controller policy fixes from code review"

This reverts commit 97e8b8379c.

* Simplify LayoutSimple

* Fix CanViewInvoices condition

Co-authored-by: Kukks <evilkukka@gmail.com>
2021-12-31 16:36:38 +09:00

85 lines
3.7 KiB
Text

@using BTCPayServer.Views.Stores
@using BTCPayServer.Abstractions.Extensions
@model BTCPayServer.Plugins.Shopify.Models.ShopifySettings
@{
ViewData.SetActivePage("shopify", nameof(StoreNavPages), "Shopify", Context.GetStoreData().Id);
var shopifyCredsSet = Model?.IntegratedAt.HasValue is true;
var shopifyUrl = Model?.ShopifyUrl;
}
<partial name="_StatusMessage"/>
<h2 class="mt-1 mb-4">
@ViewData["Title"]
<small>
<a href="https://docs.btcpayserver.org/Shopify" target="_blank" rel="noreferrer noopener">
<span class="fa fa-question-circle-o text-secondary" title="More information..."></span>
</a>
</small>
</h2>
<form method="post" id="shopifyForm">
@if (!shopifyCredsSet)
{
<p class="alert alert-info">Create a Shopify Private App with the permissions "Orders - Read and write"</p>
<div class="form-group">
<label class="form-label" for="exampleUrl">Example Url from Shopify Private App</label>
<input class="form-control" id="exampleUrl" name="exampleUrl">
</div>
<button name="command" type="submit" class="btn btn-primary" value="ShopifySaveCredentials">Connect to Shopify</button>
}
else
{
<div class="form-group">
<label asp-for="ShopName" class="form-label"></label>
<div class="input-group">
@if (!Model?.ShopName?.Contains(".") is true)
{
<span class="input-group-text">https://</span>
}
<input asp-for="ShopName" class="form-control" readonly="@shopifyCredsSet"/>
@if (!Model?.ShopName?.Contains(".") is true)
{
<span class="input-group-text">.myshopify.com</span>
}
</div>
<span asp-validation-for="ShopName" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="ApiKey" class="form-label"></label>
<input asp-for="ApiKey" class="form-control" readonly="@shopifyCredsSet"/>
<span asp-validation-for="ApiKey" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="Password" class="form-label"></label>
<input asp-for="Password" class="form-control" type="password" value="@Model?.Password" readonly="@shopifyCredsSet"/>
<span asp-validation-for="Password" class="text-danger"></span>
</div>
<div class="alert alert-warning">
<p>
In Shopify please paste following script at <a href="@shopifyUrl/admin/settings/checkout#PolarisTextField1" target="_blank" class="fw-bold" rel="noreferrer noopener"> Settings &gt; Checkout &gt; Order Processing &gt; Additional Scripts</a>
</p>
<kbd style="display: block; word-break: break-all;">
@($"<script src='{Url.Action("ShopifyJavascript", "Shopify", new { storeId = Context.GetRouteValue("storeId") }, Context.Request.Scheme)}'></script>")
</kbd>
</div>
<p class="alert alert-warning">
In Shopify please add a payment method at <a target="_blank" href="@shopifyUrl/admin/settings/payments" class="fw-bold" rel="noreferrer noopener"> Settings &gt; Payments &gt; Manual Payment Methods</a> with the name <kbd>Bitcoin with BTCPay Server</kbd>
</p>
<p class="alert alert-success">
Orders on <b>@Model.ShopName</b>.myshopify.com will be marked as paid on successful invoice payment.
Started: @Model.IntegratedAt.Value.ToBrowserDate()
</p>
<button name="command" type="submit" class="btn btn-danger" value="ShopifyClearCredentials">
Stop Shopify calls and clear credentials
</button>
}
</form>