2020-09-13 17:12:42 -05:00
|
|
|
@using static BTCPayServer.Data.StoreBlob
|
|
|
|
@model IntegrationsViewModel
|
|
|
|
@{
|
|
|
|
Layout = "../Shared/_NavLayout.cshtml";
|
|
|
|
ViewData.SetActivePageAndTitle(StoreNavPages.Integrations, "Integrations");
|
2020-09-13 17:32:02 -05:00
|
|
|
|
|
|
|
|
|
|
|
var shopify = Model.Shopify;
|
|
|
|
var shopifyCredsSet = shopify?.CredentialsValid == true;
|
2020-09-13 17:12:42 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
<partial name="_StatusMessage" />
|
|
|
|
|
|
|
|
@if (!ViewContext.ModelState.IsValid)
|
|
|
|
{
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-6">
|
|
|
|
<div asp-validation-summary="All" class="text-danger"></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
}
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-8">
|
|
|
|
<form method="post">
|
|
|
|
<h4 class="mb-3">Shopify</h4>
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
<label asp-for="Shopify.ShopName"></label>
|
|
|
|
<a href="https://docs.btcpayserver.org/Theme/#checkout-page-themes" target="_blank"><span class="fa fa-question-circle-o" title="More information..."></span></a>
|
2020-09-13 17:32:02 -05:00
|
|
|
<input asp-for="Shopify.ShopName" class="form-control" readonly="@shopifyCredsSet" />
|
2020-09-13 17:12:42 -05:00
|
|
|
<span asp-validation-for="Shopify.ShopName" class="text-danger"></span>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
<label asp-for="Shopify.ApiKey"></label>
|
|
|
|
<a href="https://docs.btcpayserver.org/Theme/#checkout-page-themes" target="_blank"><span class="fa fa-question-circle-o" title="More information..."></span></a>
|
2020-09-13 17:32:02 -05:00
|
|
|
<input asp-for="Shopify.ApiKey" class="form-control" readonly="@shopifyCredsSet" />
|
2020-09-13 17:12:42 -05:00
|
|
|
<span asp-validation-for="Shopify.ApiKey" class="text-danger"></span>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
<label asp-for="Shopify.Password"></label>
|
|
|
|
<a href="https://docs.btcpayserver.org/Theme/#checkout-page-themes" target="_blank"><span class="fa fa-question-circle-o" title="More information..."></span></a>
|
2020-09-13 17:32:02 -05:00
|
|
|
<input asp-for="Shopify.Password" class="form-control" readonly="@shopifyCredsSet" />
|
2020-09-13 17:12:42 -05:00
|
|
|
<span asp-validation-for="Shopify.Password" class="text-danger"></span>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
<label asp-for="Shopify.SharedSecret"></label>
|
|
|
|
<a href="https://docs.btcpayserver.org/Theme/#checkout-page-themes" target="_blank"><span class="fa fa-question-circle-o" title="More information..."></span></a>
|
2020-09-13 17:32:02 -05:00
|
|
|
<input asp-for="Shopify.SharedSecret" class="form-control" readonly="@shopifyCredsSet" />
|
2020-09-13 17:12:42 -05:00
|
|
|
<span asp-validation-for="Shopify.SharedSecret" class="text-danger"></span>
|
|
|
|
</div>
|
|
|
|
|
2020-09-13 17:32:02 -05:00
|
|
|
@if (!shopifyCredsSet)
|
2020-09-13 17:12:42 -05:00
|
|
|
{
|
|
|
|
<button name="command" type="submit" class="btn btn-primary" value="ShopifySaveCredentials">Save Credentials</button>
|
|
|
|
}
|
2020-09-13 17:32:02 -05:00
|
|
|
else if (shopify?.IntegratedAt.HasValue == true)
|
2020-09-13 17:12:42 -05:00
|
|
|
{
|
2020-09-13 17:32:02 -05:00
|
|
|
<p>
|
|
|
|
Orders on <b>@shopify.ShopName</b>.myshopify.com will be marked as paid on successful invoice payment.
|
|
|
|
Started: @shopify.IntegratedAt.Value.ToBrowserDate()
|
|
|
|
</p>
|
2020-09-13 17:12:42 -05:00
|
|
|
}
|
|
|
|
|
2020-09-13 17:32:02 -05:00
|
|
|
@if (shopifyCredsSet)
|
2020-09-13 17:12:42 -05:00
|
|
|
{
|
|
|
|
if (!shopify.IntegratedAt.HasValue)
|
|
|
|
{
|
|
|
|
<button name="command" type="submit" class="btn btn-primary" value="ShopifyIntegrate">Integrate Shopify Order Paid Marking</button>
|
|
|
|
}
|
2020-09-13 17:35:18 -05:00
|
|
|
<button name="command" type="submit" class="btn btn-danger" value="ShopifyClearCredentials">Clear Credentials</button>
|
2020-09-13 17:12:42 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
@section Scripts {
|
|
|
|
@await Html.PartialAsync("_ValidationScriptsPartial")
|
|
|
|
}
|