direct call to pay type instance

This commit is contained in:
Kukks
2023-06-01 12:07:07 +02:00
parent 3823f9461c
commit 68a291c705
5 changed files with 8 additions and 8 deletions

View File

@@ -154,7 +154,7 @@ public class Zapper : IHostedService
{ {
if (arg.EventCode != InvoiceEventCode.Completed && arg.EventCode != InvoiceEventCode.MarkedCompleted) if (arg.EventCode != InvoiceEventCode.Completed && arg.EventCode != InvoiceEventCode.MarkedCompleted)
return; return;
var pm = arg.Invoice.GetPaymentMethod(new PaymentMethodId("BTC", PaymentTypes.LNURLPay)); var pm = arg.Invoice.GetPaymentMethod(new PaymentMethodId("BTC", LNURLPayPaymentType.Instance));
if (pm is null) if (pm is null)
{ {
return; return;

View File

@@ -115,7 +115,7 @@ namespace BTCPayServer.Plugins.Prism
var store = await _storeRepository.FindStore(payout.StoreDataId); var store = await _storeRepository.FindStore(payout.StoreDataId);
var network = _btcPayNetworkProvider.GetNetwork<BTCPayNetwork>("BTC"); var network = _btcPayNetworkProvider.GetNetwork<BTCPayNetwork>("BTC");
var id = new PaymentMethodId("BTC", PaymentTypes.LightningLike); var id = new PaymentMethodId("BTC", LightningPaymentType.Instance);
var existing = store.GetSupportedPaymentMethods(_btcPayNetworkProvider) var existing = store.GetSupportedPaymentMethods(_btcPayNetworkProvider)
.OfType<LightningSupportedPaymentMethod>() .OfType<LightningSupportedPaymentMethod>()
.FirstOrDefault(d => d.PaymentId == id); .FirstOrDefault(d => d.PaymentId == id);
@@ -286,7 +286,7 @@ namespace BTCPayServer.Plugins.Prism
new[] {InvoiceEventCode.Completed, InvoiceEventCode.MarkedCompleted}.Contains( new[] {InvoiceEventCode.Completed, InvoiceEventCode.MarkedCompleted}.Contains(
invoiceEvent.EventCode)) invoiceEvent.EventCode))
{ {
var pm = invoiceEvent.Invoice.GetPaymentMethod(new PaymentMethodId("BTC", PaymentTypes.LNURLPay)); var pm = invoiceEvent.Invoice.GetPaymentMethod(new PaymentMethodId("BTC", LNURLPayPaymentType.Instance));
var pmd = pm?.GetPaymentMethodDetails() as LNURLPayPaymentMethodDetails; var pmd = pm?.GetPaymentMethodDetails() as LNURLPayPaymentMethodDetails;
if (string.IsNullOrEmpty(pmd?.ConsumedLightningAddress)) if (string.IsNullOrEmpty(pmd?.ConsumedLightningAddress))
{ {
@@ -363,7 +363,7 @@ namespace BTCPayServer.Plugins.Prism
Destination = new LNURLPayClaimDestinaton(destination), Destination = new LNURLPayClaimDestinaton(destination),
PreApprove = true, PreApprove = true,
StoreId = storeId, StoreId = storeId,
PaymentMethodId = new PaymentMethodId("BTC", PaymentTypes.LightningLike), PaymentMethodId = new PaymentMethodId("BTC", LightningPaymentType.Instance),
Value = Money.Satoshis(payoutAmount).ToDecimal(MoneyUnit.BTC), Value = Money.Satoshis(payoutAmount).ToDecimal(MoneyUnit.BTC),
}); });
if (payout.Result == ClaimRequest.ClaimResult.Ok) if (payout.Result == ClaimRequest.ClaimResult.Ok)

View File

@@ -633,7 +633,7 @@ public async Task<IEnumerable<IDestination>> GetNextDestinationsAsync(int count,
})).Select(async data => })).Select(async data =>
{ {
var claim = await _bitcoinLikePayoutHandler.ParseClaimDestination(new PaymentMethodId("BTC", PaymentTypes.BTCLike), var claim = await _bitcoinLikePayoutHandler.ParseClaimDestination(new PaymentMethodId("BTC", BitcoinPaymentType.Instance),
data.Destination, CancellationToken.None); data.Destination, CancellationToken.None);
if (!string.IsNullOrEmpty(claim.error) || claim.destination is not IBitcoinLikeClaimDestination bitcoinLikeClaimDestination ) if (!string.IsNullOrEmpty(claim.error) || claim.destination is not IBitcoinLikeClaimDestination bitcoinLikeClaimDestination )

View File

@@ -18,7 +18,7 @@
var op = OutPoint.Parse(coin.Outpoint); var op = OutPoint.Parse(coin.Outpoint);
<tr> <tr>
<td> <td>
<a href="@PaymentTypes.BTCLike.GetTransactionLink(BtcPayNetworkProvider.BTC, op.Hash.ToString())" target="_blank" class="text-break"> <a href="@BitcoinPaymentType.Instance.GetTransactionLink(BtcPayNetworkProvider.BTC, op.Hash.ToString())" target="_blank" class="text-break">
@coin.Outpoint @coin.Outpoint
</a> </a>
@@ -68,7 +68,7 @@
<span class="text-break">@cjData.CoordinatorName</span> <span class="text-break">@cjData.CoordinatorName</span>
</td> </td>
<td> <td>
<a href="@PaymentTypes.BTCLike.GetTransactionLink(network, cjData.Transaction)" target="_blank" class="text-break"> <a href="@BitcoinPaymentType.Instance.GetTransactionLink(network, cjData.Transaction)" target="_blank" class="text-break">
@cjData.Transaction @cjData.Transaction
</a> </a>
</td> </td>

View File

@@ -105,7 +105,7 @@ public class WabisabiPlugin : BaseBTCPayServerPlugin
// //
// public IEnumerable<PaymentMethodId> GetSupportedPaymentMethods() // public IEnumerable<PaymentMethodId> GetSupportedPaymentMethods()
// { // {
// return new[] {new PaymentMethodId("BTC", PaymentTypes.BTCLike)}; // return new[] {new PaymentMethodId("BTC", BitcoinPaymentType.Instance)};
// } // }
// //
// public Task<IHostedService> ConstructProcessor(PayoutProcessorData settings) // public Task<IHostedService> ConstructProcessor(PayoutProcessorData settings)