Shopify credentials clearing that stops order marking

This commit is contained in:
rockstardev
2020-09-13 17:35:18 -05:00
committed by Kukks
parent d530059e7e
commit 05b45f8cf5
2 changed files with 13 additions and 4 deletions

View File

@@ -1040,6 +1040,18 @@ namespace BTCPayServer.Controllers
}
TempData[WellKnownTempData.SuccessMessage] = "Shopify integration successfully turned on";
}
else if (command == "ShopifyClearCredentials")
{
var shopify = vm.Shopify;
var blob = CurrentStore.GetStoreBlob();
blob.Shopify = null;
if (CurrentStore.SetStoreBlob(blob))
{
await _Repo.UpdateStore(CurrentStore);
}
TempData[WellKnownTempData.SuccessMessage] = "Shopify integration credentials cleared";
}
return RedirectToAction(nameof(Integrations), new
{

View File

@@ -63,18 +63,15 @@
Orders on <b>@shopify.ShopName</b>.myshopify.com will be marked as paid on successful invoice payment.
Started: @shopify.IntegratedAt.Value.ToBrowserDate()
</p>
<p></p>
}
@if (shopifyCredsSet)
{
<h5 class="mt-9 mb-3">Shopify Operations</h5>
if (!shopify.IntegratedAt.HasValue)
{
<button name="command" type="submit" class="btn btn-primary" value="ShopifyIntegrate">Integrate Shopify Order Paid Marking</button>
}
<button name="command" type="submit" class="btn btn-error" value="ShopifyClearCredentials">Clear Credentials</button>
<button name="command" type="submit" class="btn btn-danger" value="ShopifyClearCredentials">Clear Credentials</button>
}
</form>