btcpayserver / btcpayserver-plugins

A repository storing verified BTCPay Server Plugins.
https://btcpayserver.org
19 stars 5 forks source link

Printable QR codes does not work with LN bank #20

Closed iBobik closed 2 years ago

iBobik commented 2 years ago

Describe the bug When I try to pay to static LNURL QR code it fails to create invoice.

To Reproduce the bug Steps to reproduce the reported bug:

  1. Create store with LN bank wallet and POS app with printable QR codes
  2. Scan QR code with a wallet
  3. Write amount and continue
  4. Fail on 404 bad request

Expected behavior

It will work.

Your BTCPay Environment (please complete the following information):

Logs (if applicable)

stdout:

fail: Microsoft.AspNetCore.Server.Kestrel: Connection id "0HMGT93Q93H3A", Request id "0HMGT93Q93H3A:00000002": An unhandled exception was thrown by the application.
BTCPayServer.Client.GreenfieldAPIException: Value cannot be null. (Parameter 'description')
   at BTCPayServer.Controllers.Greenfield.LocalBTCPayServerClient.HandleActionResult(IActionResult result) in /source/BTCPayServer/Controllers/GreenField/LocalBTCPayServerClient.cs:line 592
   at BTCPayServer.Controllers.Greenfield.LocalBTCPayServerClient.GetFromActionResult[T](IActionResult result) in /source/BTCPayServer/Controllers/GreenField/LocalBTCPayServerClient.cs:line 573
   at BTCPayServer.Controllers.Greenfield.LocalBTCPayServerClient.CreateLightningInvoice(String cryptoCode, CreateLightningInvoiceRequest request, CancellationToken token) in /source/BTCPayServer/Controllers/GreenField/LocalBTCPayServerClient.cs:line 567
   at BTCPayServer.Plugins.LNbank.Services.BTCPayService.CreateLightningInvoice(LightningInvoiceCreateRequest req) in /home/d11n/Sources/btcpay/server/BTCPayServer.Plugins.LNbank/Services/BTCPayService.cs:line 23
   at BTCPayServer.Plugins.LNbank.Services.Wallets.WalletService.Receive(Wallet wallet, Int64 amount, String description, uint256 descriptionHash, Boolean attachDescription, Boolean privateRouteHints, Nullable`1 expiry) in /home/d11n/Sources/btcpay/server/BTCPayServer.Plugins.LNbank/Services/Wallets/WalletService.cs:line 105
   at BTCPayServer.Plugins.LNbank.Services.Wallets.WalletService.Receive(Wallet wallet, Int64 amount, String description, uint256 descriptionHash, Boolean attachDescription, Boolean privateRouteHints, Nullable`1 expiry) in /home/d11n/Sources/btcpay/server/BTCPayServer.Plugins.LNbank/Services/Wallets/WalletService.cs:line 126
   at BTCPayServer.Plugins.LNbank.Services.Wallets.WalletService.Receive(Wallet wallet, Int64 amount, uint256 descriptionHash, Boolean privateRouteHints, Nullable`1 expiry) in /home/d11n/Sources/btcpay/server/BTCPayServer.Plugins.LNbank/Services/Wallets/WalletService.cs:line 98
   at BTCPayServer.Plugins.LNbank.Controllers.API.LightningController.CreateLightningInvoice(LightningInvoiceCreateRequest req) in /home/d11n/Sources/btcpay/server/BTCPayServer.Plugins.LNbank/Controllers/API/LightningController.cs:line 39
   at lambda_method1429(Closure , Object )
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ExceptionContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeNextResourceFilter()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Authorization.Policy.AuthorizationMiddlewareResultHandler.HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at BTCPayServer.Hosting.BTCPayMiddleware.Invoke(HttpContext httpContext) in /source/BTCPayServer/Hosting/BTCpayMiddleware.cs:line 101
   at BTCPayServer.Hosting.GreenfieldMiddleware.Invoke(HttpContext httpContext) in /source/BTCPayServer/Hosting/GreenfieldMiddleware.cs:line 50
   at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context)
   at BTCPayServer.Hosting.HeadersOverrideMiddleware.Invoke(HttpContext httpContext) in /source/BTCPayServer/Hosting/HeadersOverrideMiddleware.cs:line 30
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)

Setup Parameters

BTCPAY_PROTOCOL:https
BTCPAY_HOST:pay.xxx
BTCPAY_ADDITIONAL_HOSTS:pay.xxx
REVERSEPROXY_HTTP_PORT:80
REVERSEPROXY_HTTPS_PORT:443
REVERSEPROXY_DEFAULT_HOST:none
LIBREPATRON_HOST:
ZAMMAD_HOST:
WOOCOMMERCE_HOST:
BTCTRANSMUTER_HOST:
CHATWOOT_HOST:
BTCPAY_ENABLE_SSH:false
BTCPAY_HOST_SSHKEYFILE:
LETSENCRYPT_EMAIL:
NBITCOIN_NETWORK:mainnet
LIGHTNING_ALIAS:
BTCPAYGEN_CRYPTO1:btc
BTCPAYGEN_CRYPTO2:
BTCPAYGEN_CRYPTO3:
BTCPAYGEN_CRYPTO4:
BTCPAYGEN_CRYPTO5:
BTCPAYGEN_CRYPTO6:
BTCPAYGEN_CRYPTO7:
BTCPAYGEN_CRYPTO8:
BTCPAYGEN_CRYPTO9:
BTCPAYGEN_REVERSEPROXY:traefik
BTCPAYGEN_LIGHTNING:lnd
BTCPAYGEN_ADDITIONAL_FRAGMENTS:opt-save-storage-xs;opt-lnd-autopilot;opt-lnd-wtclient;opt-add-btctransmuter;opt-add-thunderhub;lnbits.custom;traefik;btcpayserver-traefik.custom
BTCPAYGEN_EXCLUDE_FRAGMENTS:nginx-https
BTCPAY_IMAGE:
ACME_CA_URI:production
TOR_RELAY_NICKNAME: 
TOR_RELAY_EMAIL: 
PIHOLE_SERVERIP: 
FIREFLY_HOST: 

Additional context

POS app is hosted on different domain, but it behaves the same on the main domain.

dennisreimann commented 2 years ago

Thanks for reporting, I will take care of that! Are you using LNbank v1.2.0?

iBobik commented 2 years ago

I think yes, checked for updates yesterday.

Honza Pobořil

14. 4. 2022 v 8:13, d11n @.***>:

 Thanks for reporting, I will take care of that! Are you using LNbank v1.2.0?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.

dennisreimann commented 2 years ago

Will be fixed with v1.5.0 + LNbank v1.2.1

iBobik commented 2 years ago

Thank you for the quick fix. When it will be released?

dennisreimann commented 2 years ago

@iBobik Release v1.2.1 is up now - btcpayserver/btcpayserver-plugins#21 needs merging, then it will be available on the plugins page.