From df6ba5fb9f14ff62a9cbadecbe151b53881db133 Mon Sep 17 00:00:00 2001 From: Volodymyr Mykytenko <97235161+vmykytenko-sift@users.noreply.github.com> Date: Tue, 16 Jul 2024 13:19:35 +0300 Subject: [PATCH] [PAY-5021]: Added new Guest fields and incremented version. (#110) --- CHANGES.MD | 4 ++++ README.md | 4 ++-- build.gradle | 2 +- src/main/java/com/siftscience/Constants.java | 2 +- .../java/com/siftscience/model/Guest.java | 20 +++++++++++++++++++ .../com/siftscience/CreateOrderEventTest.java | 4 +++- .../java/com/siftscience/SiftRequestTest.java | 2 +- src/test/java/com/siftscience/TestUtils.java | 4 +++- .../com/siftscience/UpdateOrderEventTest.java | 4 +++- 9 files changed, 38 insertions(+), 8 deletions(-) diff --git a/CHANGES.MD b/CHANGES.MD index 807284a..05c5525 100644 --- a/CHANGES.MD +++ b/CHANGES.MD @@ -1,3 +1,7 @@ +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 + 3.14.2 (2024-05-20) ================= - Fixed bug with okHttp causing SocketTimeoutException diff --git a/README.md b/README.md index 850d5bb..aff7410 100644 --- a/README.md +++ b/README.md @@ -13,13 +13,13 @@ Java 1.7 or later. com.siftscience sift-java - 3.14.2 + 3.15.2 ``` ### Gradle ``` dependencies { - compile 'com.siftscience:sift-java:3.14.2' + compile 'com.siftscience:sift-java:3.15.2' } ``` ### Other diff --git a/build.gradle b/build.gradle index a8f1db6..9674009 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ apply plugin: 'signing' apply plugin: 'java-library-distribution' group = 'com.siftscience' -version = '3.14.2' +version = '3.15.2' repositories { mavenCentral() diff --git a/src/main/java/com/siftscience/Constants.java b/src/main/java/com/siftscience/Constants.java index 6e37b7e..822956d 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.14.2"; + public static final String LIB_VERSION = "3.15.2"; 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/Guest.java b/src/main/java/com/siftscience/model/Guest.java index 426dc05..acbf383 100644 --- a/src/main/java/com/siftscience/model/Guest.java +++ b/src/main/java/com/siftscience/model/Guest.java @@ -10,6 +10,8 @@ public class Guest { @Expose @SerializedName("$loyalty_program") private String loyaltyProgram; @Expose @SerializedName("$loyalty_program_id") private String loyaltyProgramId; @Expose @SerializedName("$birth_date") private String birthDate; + @Expose @SerializedName("$guest_user_id") private String guestUserId; + @Expose @SerializedName("$guest_booking_reference_id") private String guestBookingReferenceId; public String getName() { return name; @@ -64,4 +66,22 @@ public Guest setBirthDate(String birthDate) { this.birthDate = birthDate; return this; } + + public String getGuestUserId() { + return guestUserId; + } + + public Guest setGuestUserId(String guestUserId) { + this.guestUserId = guestUserId; + return this; + } + + public String getGuestBookingReferenceId() { + return guestBookingReferenceId; + } + + public Guest setGuestBookingReferenceId(String guestBookingReferenceId) { + this.guestBookingReferenceId = guestBookingReferenceId; + return this; + } } diff --git a/src/test/java/com/siftscience/CreateOrderEventTest.java b/src/test/java/com/siftscience/CreateOrderEventTest.java index c83f3bf..f93286e 100644 --- a/src/test/java/com/siftscience/CreateOrderEventTest.java +++ b/src/test/java/com/siftscience/CreateOrderEventTest.java @@ -85,7 +85,9 @@ public void testCreateOrderEventWithBookings() throws JSONException, IOException " \"$loyalty_program\": \"skymiles\",\n" + " \"$loyalty_program_id\": \"PSOV34DF\",\n" + " \"$phone\": \"1-415-555-6040\",\n" + - " \"$email\": \"jdoe@domain.com\"\n" + + " \"$email\": \"jdoe@domain.com\",\n" + + " \"$guest_user_id\": \"johndoe_1985-01-19\",\n" + + " \"$guest_booking_reference_id\": \"AO0999837df\"\n" + " },\n" + " {\n" + " \"$name\": \"Jane Doe\"\n" + diff --git a/src/test/java/com/siftscience/SiftRequestTest.java b/src/test/java/com/siftscience/SiftRequestTest.java index f6ef2cb..785d04d 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.14.2", recordedRequest.getHeader("User-Agent")); + Assert.assertEquals("SiftScience/v205 sift-java/3.15.2", recordedRequest.getHeader("User-Agent")); } @Test diff --git a/src/test/java/com/siftscience/TestUtils.java b/src/test/java/com/siftscience/TestUtils.java index 92e9819..52c9f43 100644 --- a/src/test/java/com/siftscience/TestUtils.java +++ b/src/test/java/com/siftscience/TestUtils.java @@ -204,7 +204,9 @@ static Guest sampleGuest1() { .setLoyaltyProgram("skymiles") .setLoyaltyProgramId("PSOV34DF") .setPhone("1-415-555-6040") - .setEmail("jdoe@domain.com"); + .setEmail("jdoe@domain.com") + .setGuestUserId("johndoe_1985-01-19") + .setGuestBookingReferenceId("AO0999837df"); } static Guest sampleGuest2() { diff --git a/src/test/java/com/siftscience/UpdateOrderEventTest.java b/src/test/java/com/siftscience/UpdateOrderEventTest.java index fea32d2..5e6b917 100644 --- a/src/test/java/com/siftscience/UpdateOrderEventTest.java +++ b/src/test/java/com/siftscience/UpdateOrderEventTest.java @@ -86,7 +86,9 @@ public void testUpdateOrderEventWithBookings() throws JSONException, IOException " \"$loyalty_program\": \"skymiles\",\n" + " \"$loyalty_program_id\": \"PSOV34DF\",\n" + " \"$phone\": \"1-415-555-6040\",\n" + - " \"$email\": \"jdoe@domain.com\"\n" + + " \"$email\": \"jdoe@domain.com\",\n" + + " \"$guest_user_id\": \"johndoe_1985-01-19\",\n" + + " \"$guest_booking_reference_id\": \"AO0999837df\"\n" + " },\n" + " {\n" + " \"$name\": \"Jane Doe\"\n" +