2020-09-18 17:20:31 +02:00
|
|
|
using System;
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
2021-04-08 06:37:05 +02:00
|
|
|
using Newtonsoft.Json;
|
2020-09-18 17:20:31 +02:00
|
|
|
|
2021-04-08 06:37:05 +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; }
|
2021-04-08 06:37:05 +02:00
|
|
|
|
|
|
|
[JsonIgnore]
|
|
|
|
public string ShopifyUrl
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
return ShopName?.Contains(".") is true ? $"https://{ShopName}.myshopify.com" : ShopName;
|
|
|
|
}
|
|
|
|
}
|
2020-09-18 17:20:31 +02:00
|
|
|
}
|
|
|
|
}
|