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

33 lines
915 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; }
public string ApiKey { get; set; }
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
{
2021-05-26 13:11:59 +02:00
return ShopName?.Contains(".", StringComparison.OrdinalIgnoreCase) is true ? ShopName : $"https://{ShopName}.myshopify.com" ;
}
}
2020-09-18 17:20:31 +02:00
}
}