Set delivery state to "Delivered" without setting payment status to "Paid"

Hi,

I’m using “DirectPay: DirectPayment” as a payment method. I set the delivery state to “Processing”, which sets the order state to “Processing” as well. Now, when the delivery is shipped (delivered), I want to change the delivery state to “Delivered” without automatically changing payment status to “Paid”. Is this possible?

The reason is because of external, manual, invoice handling. When the invoice is paid by the customer, the ERP should send a request to our API stating that the payment is done, but at this time, the package could’ve been delivered already.

Litium version: 7.6.2

Are you using Accelerator or Litium connect for this? In Litium Connect, we do not support that flow. If you are just using this in accelerator then you can remove the Capture part from accelerator code.

In the accelerator.

Where can I find the capture part? I’m pretty novice in the state transition area, if that’s where it is.

You can take a look at

DeliveryStateBuilder.cs

and

OrderStateBuilder.cs

in folder:

Litium.Accelerator.StateTransitions

the DeliveryStateBuilder triggers completpayments unless you are using the connect erp API and have related payments.

if (!deliveryCarrier.AdditionalDeliveryInfo.Any(x => x.Key == RELATED_PAYMENT_KEY))
                    {
                        _orderUtilities.CompletePayments(ModuleECommerce.Instance.Orders[deliveryCarrier.OrderID, token], token);
                    }

When delivery enter state delivered completepayments are triggered for all payments on the order.

2 Likes

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