mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 14:34:23 +01:00
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<TargetFramework>netcoreapp2.1</TargetFramework>
|
<TargetFramework>netcoreapp2.1</TargetFramework>
|
||||||
<Version>1.0.3.56</Version>
|
<Version>1.0.3.57</Version>
|
||||||
<NoWarn>NU1701,CA1816,CA1308,CA1810,CA2208</NoWarn>
|
<NoWarn>NU1701,CA1816,CA1308,CA1810,CA2208</NoWarn>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
|
|||||||
@@ -102,15 +102,18 @@ namespace BTCPayServer.Controllers
|
|||||||
entity.RefundMail = entity.BuyerInformation.BuyerEmail;
|
entity.RefundMail = entity.BuyerInformation.BuyerEmail;
|
||||||
}
|
}
|
||||||
|
|
||||||
var currencyInfo = _CurrencyNameTable.GetNumberFormatInfo(invoice.Currency, false);
|
if (invoice.TaxIncluded is decimal taxIncluded)
|
||||||
if (currencyInfo != null)
|
|
||||||
{
|
{
|
||||||
invoice.Price = Math.Round(invoice.Price, currencyInfo.CurrencyDecimalDigits);
|
var currencyInfo = _CurrencyNameTable.GetNumberFormatInfo(invoice.Currency, false);
|
||||||
invoice.TaxIncluded = Math.Round(invoice.TaxIncluded, currencyInfo.CurrencyDecimalDigits);
|
if (currencyInfo != null)
|
||||||
|
{
|
||||||
|
invoice.Price = Math.Round(invoice.Price, currencyInfo.CurrencyDecimalDigits);
|
||||||
|
invoice.TaxIncluded = Math.Round(taxIncluded, currencyInfo.CurrencyDecimalDigits);
|
||||||
|
}
|
||||||
|
invoice.Price = Math.Max(0.0m, invoice.Price);
|
||||||
|
invoice.TaxIncluded = Math.Max(0.0m, taxIncluded);
|
||||||
|
invoice.TaxIncluded = Math.Min(taxIncluded, invoice.Price);
|
||||||
}
|
}
|
||||||
invoice.Price = Math.Max(0.0m, invoice.Price);
|
|
||||||
invoice.TaxIncluded = Math.Max(0.0m, invoice.TaxIncluded);
|
|
||||||
invoice.TaxIncluded = Math.Min(invoice.TaxIncluded, invoice.Price);
|
|
||||||
|
|
||||||
entity.ProductInformation = Map<CreateInvoiceRequest, ProductInformation>(invoice);
|
entity.ProductInformation = Map<CreateInvoiceRequest, ProductInformation>(invoice);
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ namespace BTCPayServer.Models
|
|||||||
[JsonProperty(PropertyName = "refundable", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty(PropertyName = "refundable", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
public bool Refundable { get; set; }
|
public bool Refundable { get; set; }
|
||||||
[JsonProperty(PropertyName = "taxIncluded", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty(PropertyName = "taxIncluded", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
public decimal TaxIncluded { get; set; }
|
public decimal? TaxIncluded { get; set; }
|
||||||
[JsonProperty(PropertyName = "nonce", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty(PropertyName = "nonce", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
public long Nonce { get; set; }
|
public long Nonce { get; set; }
|
||||||
[JsonProperty(PropertyName = "guid", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty(PropertyName = "guid", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
|||||||
Reference in New Issue
Block a user