Skip to content

Commit 0f23e56

Browse files
committed
ECWID-141762 merge remote-tracking branch 'origin/master' into ECWID-141762
2 parents 037ae9f + b3e2b21 commit 0f23e56

13 files changed

Lines changed: 42 additions & 4 deletions

File tree

README.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,26 @@ apiHost=app.local.ecwid.com
1515
apiPort=8443
1616
```
1717

18+
#### Adding the Library to a Maven Project
19+
20+
To add the current library to a Maven project, you need to add the following block of code to your project's `pom.xml` file inside the `<dependencies>` tag:
21+
22+
```xml
23+
<dependency>
24+
<groupId>com.ecwid.apiclient</groupId>
25+
<artifactId>api-client</artifactId>
26+
<version>0.326.0</version>
27+
</dependency>
28+
```
29+
30+
#### Adding the Library to a Gradle Project
31+
32+
To add the current library to a Gradle project using Kotlin DSL, you need to add the following line to your project's `build.gradle.kts` file inside the `dependencies` block:
33+
34+
```kotlin
35+
implementation("com.ecwid.apiclient:api-client:0.326.0")
36+
```
37+
1838
## Examples
1939

2040
#### Simple example:
@@ -25,7 +45,7 @@ val apiClient = ApiClient.create(
2545
storeId = 1003,
2646
apiToken = "secret_mysecuretoken"),
2747
httpTransport = ApacheCommonsHttpClientTransport(),
28-
jsonTransformerProvider = GsonTransformerProvider()
48+
jsonTransformerProvider = GsonTransformerProvider())
2949

3050
val customer = apiClient.getCustomerDetails(CustomerDetailsRequest(customerId = 1))
3151
println("api/v3 customer: $customer")
@@ -39,7 +59,7 @@ val apiClient = ApiClient.create(
3959
storeId = 1003,
4060
apiToken = "secret_mysecuretoken"),
4161
httpTransport = ApacheCommonsHttpClientTransport(),
42-
jsonTransformerProvider = GsonTransformerProvider()
62+
jsonTransformerProvider = GsonTransformerProvider())
4363

4464
val requestsForBatch = listOf(CustomerDetailsRequest(1), CustomerDetailsRequest(2))
4565
val batch = apiClient.createBatch(CreateBatchRequest(requestsForBatch, stopOnFirstFailure = true))
@@ -57,6 +77,6 @@ while (true) {
5777
.map { it.toTypedResponse(FetchedCustomer::class.java) }
5878
.mapNotNull { if (it !is TypedBatchResponse.Ok<FetchedCustomer>) it.toString() else null }
5979
println("api/v3 customers: ${customers.joinToString { it.id.toString() }}, errors: ${errors.joinToString()}")
60-
break;
80+
break
6181
}
6282
```

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ fun FetchedOrder.toUpdated(): UpdatedOrder {
4747
giftCardDoubleSpending = giftCardDoubleSpending,
4848
giftCardCode = giftCardCode,
4949
giftCardId = giftCardId,
50+
giftCardUuid = giftCardUuid,
5051

5152
tax = tax,
5253
customerTaxExempt = customerTaxExempt,
@@ -336,5 +337,6 @@ fun FetchedOrder.LoyaltyRedemption.toUpdated(): UpdatedOrder.LoyaltyRedemption {
336337
return UpdatedOrder.LoyaltyRedemption(
337338
id = this.id,
338339
amount = this.amount,
340+
cancelled = this.cancelled,
339341
)
340342
}

src/main/kotlin/com/ecwid/apiclient/v3/dto/cart/request/OrderForCalculate.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ data class OrderForCalculate(
2525
val paymentOptionsDetails: PaymentOption? = null,
2626
val giftCardCode: String? = null,
2727
val giftCardId: Int? = null,
28+
val giftCardUuid: String? = null,
2829
val giftCardTransactionOrderId: Int? = null,
2930
val giftCardRedemption: Double? = null,
3031
val totalBeforeGiftCardRedemption: Double? = null,

src/main/kotlin/com/ecwid/apiclient/v3/dto/cart/result/CalculateOrderDetailsResult.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ data class CalculateOrderDetailsResult(
3636
val giftCardDoubleSpending: Boolean? = null,
3737
val giftCardCode: String? = null,
3838
val giftCardId: Int? = null,
39+
val giftCardUuid: String? = null,
3940

4041
val tax: Double? = null,
4142
val taxesOnShipping: List<TaxOnShipping>? = null,

src/main/kotlin/com/ecwid/apiclient/v3/dto/cart/result/FetchedCart.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ data class FetchedCart(
4949

5050
val giftCardCode: String? = null,
5151
val giftCardId: Int? = null,
52+
val giftCardUuid: String? = null,
5253
val giftCardRedemption: Double? = null,
5354
val totalBeforeGiftCardRedemption: Double? = null,
5455
val giftCardDoubleSpending: Boolean? = null,

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ data class UpdatedOrder(
5252
val giftCardDoubleSpending: Boolean? = null,
5353
val giftCardCode: String? = null,
5454
val giftCardId: Int? = null,
55+
val giftCardUuid: String? = null,
5556

5657
val tax: Double? = null,
5758
val customerTaxExempt: Boolean? = null,
@@ -357,6 +358,7 @@ data class UpdatedOrder(
357358
val orderDetailsDisplaySection: String? = null,
358359
val orderBy: String? = null
359360
)
361+
360362
data class Loyalty(
361363
val earned: Double? = null,
362364
val redemption: LoyaltyRedemption? = null,
@@ -366,6 +368,7 @@ data class UpdatedOrder(
366368
data class LoyaltyRedemption(
367369
val id: String? = null,
368370
val amount: Double? = null,
371+
val cancelled: Boolean? = null,
369372
)
370373

371374
companion object {

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ data class FetchedOrder(
6767
val giftCardDoubleSpending: Boolean? = null,
6868
val giftCardCode: String? = null,
6969
val giftCardId: Int? = null,
70+
val giftCardUuid: String? = null,
7071

7172
val total: Double? = null,
7273
val totalWithoutTax: Double? = null,
@@ -521,5 +522,6 @@ data class FetchedOrder(
521522
data class LoyaltyRedemption(
522523
val id: String? = null,
523524
val amount: Double? = null,
525+
val cancelled: Boolean? = null,
524526
)
525527
}

src/main/kotlin/com/ecwid/apiclient/v3/dto/report/enums/ReportType.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ enum class ReportType {
1212
visitorsByDevice,
1313
visitorsByCountry,
1414
visitorsByLanguage,
15+
topOfLandingPagesByVisitors,
1516

1617
/** orders */
1718
allOrders,
@@ -37,6 +38,6 @@ enum class ReportType {
3738
addToCartConversion,
3839
checkoutSalesFunnel,
3940
abandonedCarts,
41+
topOfProductsByAddingToFavorites,
4042

41-
topOfLandingPagesByVisitors,
4243
}

src/test/kotlin/com/ecwid/apiclient/v3/rule/NonUpdatablePropertyRules.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ val nonUpdatablePropertyRules: List<NonUpdatablePropertyRule<*, *>> = listOf(
106106
ReadOnly(FetchedCart::giftCardCode),
107107
ReadOnly(FetchedCart::giftCardDoubleSpending),
108108
ReadOnly(FetchedCart::giftCardId),
109+
ReadOnly(FetchedCart::giftCardUuid),
109110
ReadOnly(FetchedCart::giftCardRedemption),
110111
ReadOnly(FetchedCart::totalBeforeGiftCardRedemption),
111112
Ignored(FetchedCart::tax),
@@ -172,6 +173,7 @@ val nonUpdatablePropertyRules: List<NonUpdatablePropertyRule<*, *>> = listOf(
172173
ReadOnly(FetchedOrder::giftCardCode),
173174
ReadOnly(FetchedOrder::giftCardDoubleSpending),
174175
ReadOnly(FetchedOrder::giftCardId),
176+
ReadOnly(FetchedOrder::giftCardUuid),
175177
ReadOnly(FetchedOrder::giftCardRedemption),
176178
ReadOnly(FetchedOrder::totalBeforeGiftCardRedemption),
177179
ReadOnly(FetchedOrder::totalWithoutTax),

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ val calculateOrderDetailsResultNullablePropertyRules: List<NullablePropertyRule<
182182
AllowNullable(CalculateOrderDetailsResult::giftCardDoubleSpending),
183183
AllowNullable(CalculateOrderDetailsResult::giftCardCode),
184184
AllowNullable(CalculateOrderDetailsResult::giftCardId),
185+
AllowNullable(CalculateOrderDetailsResult::giftCardUuid),
185186
AllowNullable(CalculateOrderDetailsResult::totalWithoutTax),
186187
IgnoreNullable(CalculateOrderDetailsResult::usdTotal),
187188
IgnoreNullable(CalculateOrderDetailsResult::volumeDiscount)

0 commit comments

Comments
 (0)