mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-01-19 05:33:31 +01:00
ec76acd3a6
* Enable NETAnalyzers for whole project - remove obsolete analyzers so that the .NET Core SDK NETAnalyzers can be used - enable NETAnalyzers for all projects so that developers can use them by defining the AnalysisMode on individual projects This is because if we set AnalysisMode to minimal, recommended or all it would spam with warning. The idea is to be able to turn them on during development to fix recommended stuff without polluting the build output. Following commits will implement some of the Code Analysis findings * Performance hints for using char overloads for single characters (CA1834 and CA1847) CA1834: Use StringBuilder.Append(char) for single character strings CA1847: Use string.Contains(char) instead of string.Contains(string) with single characters
37 lines
1003 B
C#
37 lines
1003 B
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")]
|
|
public string ApiKey { get; set; }
|
|
|
|
[Display(Name = "Admin API access token")]
|
|
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";
|
|
}
|
|
}
|
|
}
|
|
}
|