diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedOrder.kt b/src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedOrder.kt index 76af5e35..117b83c6 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedOrder.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedOrder.kt @@ -93,6 +93,7 @@ fun FetchedOrder.toUpdated(): UpdatedOrder { paymentReference = paymentReference, loyalty = loyalty?.toUpdated(), customerFiscalCode = customerFiscalCode, + lang = lang, ) } diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/order/request/UpdatedOrder.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/order/request/UpdatedOrder.kt index cdca867a..f2ad6c9c 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/order/request/UpdatedOrder.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/order/request/UpdatedOrder.kt @@ -97,6 +97,7 @@ data class UpdatedOrder( val paymentReference: String? = null, val loyalty: Loyalty? = null, val customerFiscalCode: String? = null, + val lang: String? = null, ) : ApiUpdatedDTO { diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/order/result/FetchedOrder.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/order/result/FetchedOrder.kt index db85e017..d6daea41 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/order/result/FetchedOrder.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/order/result/FetchedOrder.kt @@ -119,6 +119,7 @@ data class FetchedOrder( val shippingLabelAvailableForShipment: Boolean = false, val loyalty: Loyalty? = null, val customerFiscalCode: String? = null, + val lang: String? = null, ) : ApiFetchedDTO, ApiResultDTO { diff --git a/src/test/kotlin/com/ecwid/apiclient/v3/entity/CartsTest.kt b/src/test/kotlin/com/ecwid/apiclient/v3/entity/CartsTest.kt index 71f89015..eba8613d 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/entity/CartsTest.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/entity/CartsTest.kt @@ -3,6 +3,7 @@ package com.ecwid.apiclient.v3.entity import com.ecwid.apiclient.v3.converter.toUpdated import com.ecwid.apiclient.v3.dto.cart.request.* import com.ecwid.apiclient.v3.dto.cart.result.CalculateOrderDetailsResult +import com.ecwid.apiclient.v3.dto.cart.result.CalculateOrderDetailsResult.DiscountInfo import com.ecwid.apiclient.v3.dto.order.enums.* import com.ecwid.apiclient.v3.dto.order.request.OrderCreateRequest import com.ecwid.apiclient.v3.dto.order.request.OrderDetailsRequest @@ -352,7 +353,7 @@ class CartsTest : BaseEntityTest() { checkPersonsEquals(orderForCalculate.billingPerson, calculatedOrder.billingPerson) checkPersonsEquals(orderForCalculate.shippingPerson, calculatedOrder.shippingPerson) assertEquals( - null, + emptyList(), calculatedOrder.discountInfo ) // TODO Discover why after each calculation this field resets to null } @@ -709,6 +710,7 @@ private fun UpdatedOrder.cleanupForComparison(order: UpdatedOrder): UpdatedOrder it.copy( appliesToItems = null ) - } + }, + lang = order.lang ) } diff --git a/src/test/kotlin/com/ecwid/apiclient/v3/entity/OrdersTest.kt b/src/test/kotlin/com/ecwid/apiclient/v3/entity/OrdersTest.kt index 34a52968..3264cfe3 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/entity/OrdersTest.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/entity/OrdersTest.kt @@ -437,7 +437,8 @@ private fun UpdatedOrder.cleanupForComparison(order: UpdatedOrder): UpdatedOrder it.copy( appliesToItems = null ) - } + }, + lang = order.lang ) } diff --git a/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedOrderRules.kt b/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedOrderRules.kt index b50d999c..9c37b0c7 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedOrderRules.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedOrderRules.kt @@ -321,4 +321,5 @@ val fetchedOrderNullablePropertyRules: List> = listOf AllowNullable(FetchedOrder.LoyaltyRedemption::amount), AllowNullable(FetchedOrder.LoyaltyRedemption::cancelled), AllowNullable(FetchedOrder::customerFiscalCode), + AllowNullable(FetchedOrder::lang), ) diff --git a/src/test/kotlin/com/ecwid/apiclient/v3/util/OrderUtils.kt b/src/test/kotlin/com/ecwid/apiclient/v3/util/OrderUtils.kt index f1ba2b1d..7942d0c6 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/util/OrderUtils.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/util/OrderUtils.kt @@ -137,6 +137,7 @@ fun generateTestOrder(): UpdatedOrder { ), refererChannel = "Referer channel " + randomAlphanumeric(8), ), + lang = "en", orderExtraFields = listOf( UpdatedOrder.OrderExtraFields( customerInputType = "TEXT",