btcpayserver/BTCPayServer/Plugins/Shopify/Models/ShopifySettings.cs
2022-03-01 09:19:28 +01:00

36 lines
1 KiB
C#

using System;
using System.ComponentModel.DataAnnotations;
using Newtonsoft.Json;
namespace BTCPayServer.Plugins.Shopify.Models
{
public class ShopifySettings
{
[Display(Name = "Shop Name")]
public string ShopName { get; set; }
[Display(Name = "Api Key (Apps->Develop Apps-> Create app)")]
public string ApiKey { get; set; }
[Display(Name = "Api Secret Key")]
public string Password { get; set; }
public bool CredentialsPopulated()
{
return
!string.IsNullOrWhiteSpace(ShopName) &&
!string.IsNullOrWhiteSpace(ApiKey) &&
!string.IsNullOrWhiteSpace(Password);
}
public DateTimeOffset? IntegratedAt { get; set; }
[JsonIgnore]
public string ShopifyUrl
{
get
{
return ShopName?.Contains(".", StringComparison.OrdinalIgnoreCase) is true ? ShopName : $"https://{ShopName}.myshopify.com";
}
}
}
}