Skip to content

Commit

Permalink
[PAY-5021]: Added new Guest fields and incremented version. (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
vmykytenko-sift authored Jul 16, 2024
1 parent cd25cd1 commit df6ba5f
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGES.MD
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ Java 1.7 or later.
<dependency>
<groupId>com.siftscience</groupId>
<artifactId>sift-java</artifactId>
<version>3.14.2</version>
<version>3.15.2</version>
</dependency>
```
### Gradle
```
dependencies {
compile 'com.siftscience:sift-java:3.14.2'
compile 'com.siftscience:sift-java:3.15.2'
}
```
### Other
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/siftscience/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
20 changes: 20 additions & 0 deletions src/main/java/com/siftscience/model/Guest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
}
4 changes: 3 additions & 1 deletion src/test/java/com/siftscience/CreateOrderEventTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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\": \"[email protected]\"\n" +
" \"$email\": \"[email protected]\",\n" +
" \"$guest_user_id\": \"johndoe_1985-01-19\",\n" +
" \"$guest_booking_reference_id\": \"AO0999837df\"\n" +
" },\n" +
" {\n" +
" \"$name\": \"Jane Doe\"\n" +
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/siftscience/SiftRequestTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion src/test/java/com/siftscience/TestUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,9 @@ static Guest sampleGuest1() {
.setLoyaltyProgram("skymiles")
.setLoyaltyProgramId("PSOV34DF")
.setPhone("1-415-555-6040")
.setEmail("[email protected]");
.setEmail("[email protected]")
.setGuestUserId("johndoe_1985-01-19")
.setGuestBookingReferenceId("AO0999837df");
}

static Guest sampleGuest2() {
Expand Down
4 changes: 3 additions & 1 deletion src/test/java/com/siftscience/UpdateOrderEventTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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\": \"[email protected]\"\n" +
" \"$email\": \"[email protected]\",\n" +
" \"$guest_user_id\": \"johndoe_1985-01-19\",\n" +
" \"$guest_booking_reference_id\": \"AO0999837df\"\n" +
" },\n" +
" {\n" +
" \"$name\": \"Jane Doe\"\n" +
Expand Down

0 comments on commit df6ba5f

Please sign in to comment.