From c41008a56d08b844f6d17ef29c7ec1b394be9196 Mon Sep 17 00:00:00 2001
From: Rajesh Somavarapu <50379761+rsomavarapu-sift@users.noreply.github.com>
Date: Thu, 26 Sep 2024 10:29:14 -0700
Subject: [PATCH] adding support for $iata_carrier_code for $booking complex
field (#111)
* adding support for iata_carrier_code
* correcting the version
---
CHANGES.MD | 4 ++++
README.md | 4 ++--
build.gradle | 2 +-
src/main/java/com/siftscience/Constants.java | 2 +-
src/main/java/com/siftscience/model/Booking.java | 10 ++++++++++
.../java/com/siftscience/CreateOrderEventTest.java | 1 +
src/test/java/com/siftscience/SiftRequestTest.java | 2 +-
src/test/java/com/siftscience/TestUtils.java | 1 +
.../java/com/siftscience/UpdateOrderEventTest.java | 3 +++
9 files changed, 24 insertions(+), 5 deletions(-)
diff --git a/CHANGES.MD b/CHANGES.MD
index 05c5525..9ede95c 100644
--- a/CHANGES.MD
+++ b/CHANGES.MD
@@ -1,3 +1,7 @@
+3.16.0 (2024-09-26)
+=================
+- Added support for `$iata_carrier_code` to the `$booking` complex field
+
3.15.2 (2024-07-11)
=================
- Added support for `$guest_user_id` and `$guest_booking_reference_id` fields to `$guest` complex field for `$create_order` and `$update_order` events
diff --git a/README.md b/README.md
index aff7410..84b0c13 100644
--- a/README.md
+++ b/README.md
@@ -13,13 +13,13 @@ Java 1.7 or later.
com.siftscience
sift-java
- 3.15.2
+ 3.16.0
```
### Gradle
```
dependencies {
- compile 'com.siftscience:sift-java:3.15.2'
+ compile 'com.siftscience:sift-java:3.16.0'
}
```
### Other
diff --git a/build.gradle b/build.gradle
index 9674009..1c677bb 100644
--- a/build.gradle
+++ b/build.gradle
@@ -5,7 +5,7 @@ apply plugin: 'signing'
apply plugin: 'java-library-distribution'
group = 'com.siftscience'
-version = '3.15.2'
+version = '3.16.0'
repositories {
mavenCentral()
diff --git a/src/main/java/com/siftscience/Constants.java b/src/main/java/com/siftscience/Constants.java
index 822956d..f78da8b 100644
--- a/src/main/java/com/siftscience/Constants.java
+++ b/src/main/java/com/siftscience/Constants.java
@@ -3,6 +3,6 @@
public class Constants {
public static final String API_VERSION = "v205";
- public static final String LIB_VERSION = "3.15.2";
+ public static final String LIB_VERSION = "3.16.0";
public static final String USER_AGENT_HEADER = String.format("SiftScience/%s sift-java/%s", API_VERSION, LIB_VERSION);
}
diff --git a/src/main/java/com/siftscience/model/Booking.java b/src/main/java/com/siftscience/model/Booking.java
index e4b9a11..ad3d40f 100644
--- a/src/main/java/com/siftscience/model/Booking.java
+++ b/src/main/java/com/siftscience/model/Booking.java
@@ -13,6 +13,7 @@ public class Booking {
@Expose @SerializedName("$price") private Long price;
@Expose @SerializedName("$currency_code") private String currencyCode;
@Expose @SerializedName("$quantity") private Long quantity;
+ @Expose @SerializedName("$iata_carrier_code") private String iataCarrierCode;
@Expose @SerializedName("$guests") private List guests;
@Expose @SerializedName("$segments") private List segments;
@Expose @SerializedName("$room_type") private String roomType;
@@ -85,6 +86,15 @@ public Booking setQuantity(Long quantity) {
return this;
}
+ public String getIataCarrierCode() {
+ return iataCarrierCode;
+ }
+
+ public Booking setIataCarrierCode(String iataCarrierCode) {
+ this.iataCarrierCode = iataCarrierCode;
+ return this;
+ }
+
public List getGuests() {
return guests;
}
diff --git a/src/test/java/com/siftscience/CreateOrderEventTest.java b/src/test/java/com/siftscience/CreateOrderEventTest.java
index f93286e..ae75669 100644
--- a/src/test/java/com/siftscience/CreateOrderEventTest.java
+++ b/src/test/java/com/siftscience/CreateOrderEventTest.java
@@ -127,6 +127,7 @@ public void testCreateOrderEventWithBookings() throws JSONException, IOException
" ],\n" +
" \"$price\": 49900000,\n" +
" \"$currency_code\": \"USD\",\n" +
+ " \"$iata_carrier_code\": \"AS\",\n" +
" \"$quantity\": 1,\n" +
" \"$tags\": [\n" +
" \"team-123\",\n" +
diff --git a/src/test/java/com/siftscience/SiftRequestTest.java b/src/test/java/com/siftscience/SiftRequestTest.java
index 785d04d..d44ec10 100644
--- a/src/test/java/com/siftscience/SiftRequestTest.java
+++ b/src/test/java/com/siftscience/SiftRequestTest.java
@@ -37,7 +37,7 @@ public void testUserAgentHeader() throws Exception {
// Verify the request.
RecordedRequest recordedRequest = server.takeRequest();
- Assert.assertEquals("SiftScience/v205 sift-java/3.15.2", recordedRequest.getHeader("User-Agent"));
+ Assert.assertEquals("SiftScience/v205 sift-java/3.16.0", recordedRequest.getHeader("User-Agent"));
}
@Test
diff --git a/src/test/java/com/siftscience/TestUtils.java b/src/test/java/com/siftscience/TestUtils.java
index 52c9f43..4834214 100644
--- a/src/test/java/com/siftscience/TestUtils.java
+++ b/src/test/java/com/siftscience/TestUtils.java
@@ -187,6 +187,7 @@ static Booking sampleBooking() {
.setSegments(segments)
.setPrice(49900000L)
.setCurrencyCode("USD")
+ .setIataCarrierCode("AS")
.setTags(sampleTags3())
.setQuantity(1L);
}
diff --git a/src/test/java/com/siftscience/UpdateOrderEventTest.java b/src/test/java/com/siftscience/UpdateOrderEventTest.java
index 5e6b917..7f3a209 100644
--- a/src/test/java/com/siftscience/UpdateOrderEventTest.java
+++ b/src/test/java/com/siftscience/UpdateOrderEventTest.java
@@ -128,6 +128,7 @@ public void testUpdateOrderEventWithBookings() throws JSONException, IOException
" ],\n" +
" \"$price\": 49900000,\n" +
" \"$currency_code\": \"USD\",\n" +
+ " \"$iata_carrier_code\": \"AS\",\n" +
" \"$quantity\": 1,\n" +
" \"$tags\": [\n" +
" \"team-123\",\n" +
@@ -331,6 +332,7 @@ public void testUpdateOrderEventWithBookingsShippingCarrierIsNull() throws IOExc
" ],\n" +
" \"$price\": 49900000,\n" +
" \"$currency_code\": \"USD\",\n" +
+ " \"$iata_carrier_code\": \"AS\",\n" +
" \"$quantity\": 1,\n" +
" \"$tags\": [\n" +
" \"team-123\",\n" +
@@ -497,6 +499,7 @@ public void testUpdateOrderEventWithBookingsShippingTrackingNumberIsNull() throw
" ],\n" +
" \"$price\": 49900000,\n" +
" \"$currency_code\": \"USD\",\n" +
+ " \"$iata_carrier_code\": \"AS\",\n" +
" \"$quantity\": 1,\n" +
" \"$tags\": [\n" +
" \"team-123\",\n" +