Trigger order payment capture from code (Klarna, Litium 8)

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.

Litium version: 8.6.1

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.

  1. Create an transaction (Litium.Sales.Transaction) with all the needed information in sub entities.
  2. Execute the transaction with help of the payment transaction manager (Litium.Sales.PaymentTransactionManager).

Thank you. I don’t think we want to use the Transaction Manager.

What exactly is needed for a full capture to occur using Shipments?

  1. Create a Full Shipment for a Sales Order, i.e., a Shipment that contains all products for the sales order
  2. Set the Shipment to Shipped (via ReadyToShip and Processing)
  3. ?

Does anything have to happen on the Sales Order itself? Order status? Payment status?

EDIT: The above steps successfully capture the payment, and move the order to Completed.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.