Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ECWID-135200 Recurring subscription orders are created without Tax ID although it's presented in the initial order #409

Merged
merged 5 commits into from
May 27, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ fun FetchedOrder.toUpdated(): UpdatedOrder {
orderExtraFields = orderExtraFields?.map(FetchedOrder.ExtraFieldsInfo::toUpdated),
paymentReference = paymentReference,
loyalty = loyalty?.toUpdated(),
customerFiscalCode = customerFiscalCode,
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ data class UpdatedOrder(
val orderExtraFields: List<OrderExtraFields>? = null,
val paymentReference: String? = null,
val loyalty: Loyalty? = null,
val customerFiscalCode: String? = null,

) : ApiUpdatedDTO {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ data class FetchedOrder(
val paymentReference: String? = null,
val shippingLabelAvailableForShipment: Boolean = false,
val loyalty: Loyalty? = null,
val customerFiscalCode: String? = null,

) : ApiFetchedDTO {

Expand Down
3 changes: 2 additions & 1 deletion src/test/kotlin/com/ecwid/apiclient/v3/entity/CartsTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,7 @@ private fun UpdatedOrder.cleanupForComparison(order: UpdatedOrder): UpdatedOrder
)
}
)
}
},
customerFiscalCode = null, // ApiOrder has empty string instead of null
)
}
3 changes: 2 additions & 1 deletion src/test/kotlin/com/ecwid/apiclient/v3/entity/OrdersTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,8 @@ private fun UpdatedOrder.cleanupForComparison(order: UpdatedOrder): UpdatedOrder
items = items?.mapIndexed { index, item ->
val requestItem = order.items?.get(index)
item.cleanupForComparison(requestItem)
}
},
customerFiscalCode = null, // ApiOrder has empty string instead of null
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,4 +318,5 @@ val fetchedOrderNullablePropertyRules: List<NullablePropertyRule<*, *>> = listOf
AllowNullable(FetchedOrder.Loyalty::redemption),
AllowNullable(FetchedOrder.LoyaltyRedemption::id),
AllowNullable(FetchedOrder.LoyaltyRedemption::amount),
AllowNullable(FetchedOrder::customerFiscalCode),
)
Loading