Hi, I asked the same question a few months ago, and now I have to revisit the question.
The same problem still occurs.
The following error is logged from the payment app (DirectPay):
2022-08-25 10:19:18.0509 [App:01] [] [ERROR] [] Microsoft.AspNetCore.Server.Kestrel - Connection id "0HMK6ETCSDC50", Request id "0HMK6ETCSDC50:00000002": An unhandled exception was thrown by the application. System.ArgumentException: Payment(SystemId=ba42f6e4-9acf-4b61-9736-ff52953141d8) was not found. (Parameter 'paymentSystemId')
at Litium.Connect.DirectPay.Services.PaymentService.CaptureAsync(Guid paymentSystemId, CaptureRequest capture) in /_/src/Litium.Connect.DirectPay/Services/PaymentService.cs:line 32
at Litium.Connect.DirectPay.Controllers.PaymentsController.Capture(Guid paymentSystemId, CaptureRequest capture) in /_/src/Litium.Connect.DirectPay/Controllers/PaymentsController.cs:line 58
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.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.<InvokeFilterPipelineAsync>g__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
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.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 Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
This error is pretty logical, as I just create the payment in Litium, I’m not manually sending anything to the payment app. Not really sure how to achieve this?
I’m using PaymentService
to create the actual payment in Litium. Then I manually create an Init transaction and an Authorize transaction (using TransactionService
), both connected to the created payment. Finally I link the payment to the order.
Litium version: 8.3.1