btcpayserver/BTCPayServer/Plugins/Shopify/Models/ShopifySettings.cs

37 lines
1,003 B
C#
Raw Normal View History

2020-09-18 17:20:31 +02:00
using System;
using System.ComponentModel.DataAnnotations;
using Newtonsoft.Json;
2020-09-18 17:20:31 +02:00
namespace BTCPayServer.Plugins.Shopify.Models
2020-09-18 17:20:31 +02:00
{
public class ShopifySettings
{
[Display(Name = "Shop Name")]
public string ShopName { get; set; }
2022-03-31 14:51:16 +02:00
[Display(Name = "Api Key")]
2020-09-18 17:20:31 +02:00
public string ApiKey { get; set; }
2022-03-31 14:51:16 +02:00
[Display(Name = "Admin API access token")]
2020-09-18 17:20:31 +02:00
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";
}
}
2020-09-18 17:20:31 +02:00
}
}