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

**URL:** <https://forum.litium.com/t/set-delivery-state-to-delivered-without-setting-payment-status-to-paid/2073>\
**Category:** Questions\
**Tags:** litium-7\
**Created:** [May 25, 2021, 8:27am UTC](https://forum.litium.com/t/set-delivery-state-to-delivered-without-setting-payment-status-to-paid/2073 "2021-05-25T08:27:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![adam.clettborn](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/adam.clettborn/32/956_2.png) [@adam.clettborn](https://forum.litium.com/u/adam.clettborn)\
**Post date:** [May 25, 2021, 8:27am UTC](https://forum.litium.com/t/set-delivery-state-to-delivered-without-setting-payment-status-to-paid/2073/1 "2021-05-25T08:27:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![steve.redstorm](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/steve.redstorm/32/14_2.png) [@steve.redstorm](https://forum.litium.com/u/steve.redstorm)\
**Post date:** [May 25, 2021, 10:03am UTC](https://forum.litium.com/t/set-delivery-state-to-delivered-without-setting-payment-status-to-paid/2073/2 "2021-05-25T10:03:53Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![adam.clettborn](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/adam.clettborn/32/956_2.png) [@adam.clettborn](https://forum.litium.com/u/adam.clettborn)\
**Post date:** [May 25, 2021, 10:37am UTC](https://forum.litium.com/t/set-delivery-state-to-delivered-without-setting-payment-status-to-paid/2073/3 "2021-05-25T10:37:27Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![steve.redstorm](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/steve.redstorm/32/14_2.png) [@steve.redstorm](https://forum.litium.com/u/steve.redstorm)\
**Post date:** [May 25, 2021, 12:01pm UTC](https://forum.litium.com/t/set-delivery-state-to-delivered-without-setting-payment-status-to-paid/2073/4 "2021-05-25T12:01:38Z")

</div>

You can take a look at

> DeliveryStateBuilder.cs

and

> OrderStateBuilder.cs

in folder:

> Litium.Accelerator.StateTransitions

---

<div class="post-metadata">

**Author:** ![Spotonkastebo](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/spotonkastebo/32/717_2.png) [@Spotonkastebo](https://forum.litium.com/u/Spotonkastebo)\
**Post date:** [May 27, 2021, 2:15pm UTC](https://forum.litium.com/t/set-delivery-state-to-delivered-without-setting-payment-status-to-paid/2073/5 "2021-05-27T14:15:57Z")

</div>

> [@adam.clettborn](#):
>
> ure part? I’m pretty novice in the state transition area,

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/litium/original/1X/12eddac3b8b661de1db86af10ac8151b571e6fb9.png) [@system](https://forum.litium.com/u/system)\
**Post date:** [June 24, 2021, 2:16pm UTC](https://forum.litium.com/t/set-delivery-state-to-delivered-without-setting-payment-status-to-paid/2073/6 "2021-06-24T14:16:35Z")

</div>

Closed on June 24, 2021, 2:16pm UTC

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