mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 06:24:24 +01:00
do not ignore transactionSpeed set at the invoice level
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||||
<Version>1.0.0.19</Version>
|
<Version>1.0.0.20</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Remove="Build\dockerfiles\**" />
|
<Compile Remove="Build\dockerfiles\**" />
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ namespace BTCPayServer.Controllers
|
|||||||
entity.ProductInformation = Map<Invoice, ProductInformation>(invoice);
|
entity.ProductInformation = Map<Invoice, ProductInformation>(invoice);
|
||||||
entity.RedirectURL = invoice.RedirectURL ?? store.StoreWebsite;
|
entity.RedirectURL = invoice.RedirectURL ?? store.StoreWebsite;
|
||||||
entity.Status = "new";
|
entity.Status = "new";
|
||||||
entity.SpeedPolicy = store.SpeedPolicy;
|
entity.SpeedPolicy = ParseSpeedPolicy(invoice.TransactionSpeed, store.SpeedPolicy);
|
||||||
entity.TxFee = (await _FeeProvider.GetFeeRateAsync()).GetFee(100); // assume price for 100 bytes
|
entity.TxFee = (await _FeeProvider.GetFeeRateAsync()).GetFee(100); // assume price for 100 bytes
|
||||||
entity.Rate = (double)await _RateProvider.GetRateAsync(invoice.Currency);
|
entity.Rate = (double)await _RateProvider.GetRateAsync(invoice.Currency);
|
||||||
entity.PosData = invoice.PosData;
|
entity.PosData = invoice.PosData;
|
||||||
@@ -117,6 +117,17 @@ namespace BTCPayServer.Controllers
|
|||||||
return new DataWrapper<InvoiceResponse>(resp) { Facade = "pos/invoice" };
|
return new DataWrapper<InvoiceResponse>(resp) { Facade = "pos/invoice" };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private SpeedPolicy ParseSpeedPolicy(string transactionSpeed, SpeedPolicy defaultPolicy)
|
||||||
|
{
|
||||||
|
var mappings = new Dictionary<string, SpeedPolicy>();
|
||||||
|
mappings.Add("low", SpeedPolicy.LowSpeed);
|
||||||
|
mappings.Add("medium", SpeedPolicy.MediumSpeed);
|
||||||
|
mappings.Add("high", SpeedPolicy.HighSpeed);
|
||||||
|
if(!mappings.TryGetValue(transactionSpeed, out SpeedPolicy policy))
|
||||||
|
policy = defaultPolicy;
|
||||||
|
return policy;
|
||||||
|
}
|
||||||
|
|
||||||
private void FillBuyerInfo(Buyer buyer, BuyerInformation buyerInformation)
|
private void FillBuyerInfo(Buyer buyer, BuyerInformation buyerInformation)
|
||||||
{
|
{
|
||||||
if(buyer == null)
|
if(buyer == null)
|
||||||
|
|||||||
Reference in New Issue
Block a user