How do I trigger payment capture on an order from code in Litium 8? We are using the Klarna App, and want to trigger payment capture in certain scenarios.
Setting the order state to Processing and then to Completed (after disabling the HasAllShipmentsShipped validation) has no effect on the payment.
In Litium 7, it was enough to set the delivery state and order state for capture to occur. We are not using Shipments in our Litium 8 solution.
The automatic process of trigger the payment is through the shipments. Doing that without shipment is something that is complicated and you need to build all the calculation logic that you need by yourself and nothing that I recommend. Even if you not using shipments I anyway will recommend that you create a shipment and platform will take care of the payment logic.
Steps for manually executing payment operations.
Create an transaction (Litium.Sales.Transaction) with all the needed information in sub entities.
Execute the transaction with help of the payment transaction manager (Litium.Sales.PaymentTransactionManager).