mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-03-13 11:35:51 +01:00
Fixup hack invoice mark complete
This commit is contained in:
parent
ee961a8691
commit
413b88faf1
1 changed files with 9 additions and 2 deletions
|
@ -426,12 +426,19 @@ namespace BTCPayServer.HostedServices
|
||||||
StoreDataId = pp.StoreId
|
StoreDataId = pp.StoreId
|
||||||
};
|
};
|
||||||
var rate = topUp.InvoiceEntity.Rates["BTC"];
|
var rate = topUp.InvoiceEntity.Rates["BTC"];
|
||||||
var cryptoAmount = Math.Round(topUp.InvoiceEntity.PaidAmount.Net / rate, 11);
|
|
||||||
|
var paidAmount = topUp.InvoiceEntity.PaidAmount.Net;
|
||||||
|
if (paidAmount == 0.0m)
|
||||||
|
// If marked as complete, the paid amount is not set.
|
||||||
|
// HOWEVER THIS FIX ONLY WORK IF THE INVOICE IS IN BTC REMOVE THIS HACK AFTER CONFERENCE
|
||||||
|
paidAmount = topUp.InvoiceEntity.Price;
|
||||||
|
|
||||||
|
var cryptoAmount = Math.Round(paidAmount / rate, 11);
|
||||||
|
|
||||||
var payoutBlob = new PayoutBlob()
|
var payoutBlob = new PayoutBlob()
|
||||||
{
|
{
|
||||||
CryptoAmount = -cryptoAmount,
|
CryptoAmount = -cryptoAmount,
|
||||||
Amount = -topUp.InvoiceEntity.PaidAmount.Net,
|
Amount = -paidAmount,
|
||||||
Destination = topUp.InvoiceEntity.Id,
|
Destination = topUp.InvoiceEntity.Id,
|
||||||
Metadata = new JObject(),
|
Metadata = new JObject(),
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue