Skip to content

Commit dafb3e9

Browse files
Merge pull request #409 from Ecwid/ECWID-135200
ECWID-135200 Recurring subscription orders are created without Tax ID although it's presented in the initial order
2 parents 482be1f + 6148e9f commit dafb3e9

6 files changed

Lines changed: 8 additions & 2 deletions

File tree

src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedOrder.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ fun FetchedOrder.toUpdated(): UpdatedOrder {
9191
orderExtraFields = orderExtraFields?.map(FetchedOrder.ExtraFieldsInfo::toUpdated),
9292
paymentReference = paymentReference,
9393
loyalty = loyalty?.toUpdated(),
94+
customerFiscalCode = customerFiscalCode,
9495
)
9596
}
9697

src/main/kotlin/com/ecwid/apiclient/v3/dto/order/request/UpdatedOrder.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ data class UpdatedOrder(
9595
val orderExtraFields: List<OrderExtraFields>? = null,
9696
val paymentReference: String? = null,
9797
val loyalty: Loyalty? = null,
98+
val customerFiscalCode: String? = null,
9899

99100
) : ApiUpdatedDTO {
100101

src/main/kotlin/com/ecwid/apiclient/v3/dto/order/result/FetchedOrder.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ data class FetchedOrder(
116116
val paymentReference: String? = null,
117117
val shippingLabelAvailableForShipment: Boolean = false,
118118
val loyalty: Loyalty? = null,
119+
val customerFiscalCode: String? = null,
119120

120121
) : ApiFetchedDTO {
121122

src/test/kotlin/com/ecwid/apiclient/v3/entity/CartsTest.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,7 @@ private fun UpdatedOrder.cleanupForComparison(order: UpdatedOrder): UpdatedOrder
696696
)
697697
}
698698
)
699-
}
699+
},
700+
customerFiscalCode = null, // ApiOrder has empty string instead of null
700701
)
701702
}

src/test/kotlin/com/ecwid/apiclient/v3/entity/OrdersTest.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,8 @@ private fun UpdatedOrder.cleanupForComparison(order: UpdatedOrder): UpdatedOrder
431431
items = items?.mapIndexed { index, item ->
432432
val requestItem = order.items?.get(index)
433433
item.cleanupForComparison(requestItem)
434-
}
434+
},
435+
customerFiscalCode = null, // ApiOrder has empty string instead of null
435436
)
436437
}
437438

src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedOrderRules.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,4 +318,5 @@ val fetchedOrderNullablePropertyRules: List<NullablePropertyRule<*, *>> = listOf
318318
AllowNullable(FetchedOrder.Loyalty::redemption),
319319
AllowNullable(FetchedOrder.LoyaltyRedemption::id),
320320
AllowNullable(FetchedOrder.LoyaltyRedemption::amount),
321+
AllowNullable(FetchedOrder::customerFiscalCode),
321322
)

0 commit comments

Comments
 (0)