Skip to content

Commit a4ff904

Browse files
Merge pull request #119 from SiftScience/adds_promotions_add_iata_carrier_code
1 parent 7b4182a commit a4ff904

File tree

13 files changed

+63
-31
lines changed

13 files changed

+63
-31
lines changed

CHANGES.MD

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
3.20.0 (2025-05-12)
2+
=================
3+
- Added support for `$promotions` complex field to `$update_account` event fields
4+
- Added support for `$iata_carrier_code` to the `$segment` complex field
5+
- Removed support for `$iata_carrier_code` in the `$booking` complex field
6+
17
3.19.0 (2025-04-24)
28
=================
39
- Added support for `$exchange_rate` complex field to `$transaction`, `$create_order`,

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ Java 1.7 or later.
1313
<dependency>
1414
<groupId>com.siftscience</groupId>
1515
<artifactId>sift-java</artifactId>
16-
<version>3.19.0</version>
16+
<version>3.20.0</version>
1717
</dependency>
1818
```
1919
### Gradle
2020
```
2121
dependencies {
22-
compile 'com.siftscience:sift-java:3.19.0'
22+
compile 'com.siftscience:sift-java:3.20.0'
2323
}
2424
```
2525
### Other

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ apply plugin: 'signing'
55
apply plugin: 'java-library-distribution'
66

77
group = 'com.siftscience'
8-
version = '3.19.0'
8+
version = '3.20.0'
99

1010
repositories {
1111
mavenCentral()

src/main/java/com/siftscience/Constants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
public class Constants {
44

55
public static final String API_VERSION = "v205";
6-
public static final String LIB_VERSION = "3.19.0";
6+
public static final String LIB_VERSION = "3.20.0";
77
public static final String USER_AGENT_HEADER = String.format("SiftScience/%s sift-java/%s", API_VERSION, LIB_VERSION);
88
}

src/main/java/com/siftscience/model/BaseAccountFieldSet.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public abstract class BaseAccountFieldSet<T extends BaseAccountFieldSet<T>>
1414
@Expose @SerializedName("$payment_methods") private List<PaymentMethod> paymentMethods;
1515
@Expose @SerializedName("$billing_address") private Address billingAddress;
1616
@Expose @SerializedName("$shipping_address") private Address shippingAddress;
17+
@Expose @SerializedName("$promotions") private List<Promotion> promotions;
1718
@Expose @SerializedName("$social_sign_on_type") private String socialSignOnType;
1819
@Expose @SerializedName("$merchant_profile") private MerchantProfile merchantProfile;
1920
@Expose @SerializedName(VERIFICATION_PHONE_NUMBER) private String verificationPhoneNumber;
@@ -107,4 +108,13 @@ public T setVerificationPhoneNumber(String verificationPhoneNumber) {
107108
this.verificationPhoneNumber = verificationPhoneNumber;
108109
return (T) this;
109110
}
111+
112+
public List<Promotion> getPromotions() {
113+
return promotions;
114+
}
115+
116+
public T setPromotions(List<Promotion> promotions) {
117+
this.promotions = promotions;
118+
return (T) this;
119+
}
110120
}

src/main/java/com/siftscience/model/Booking.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ public class Booking {
1414
@Expose @SerializedName("$currency_code") private String currencyCode;
1515
@Expose @SerializedName("$exchange_rate") private ExchangeRate exchangeRate;
1616
@Expose @SerializedName("$quantity") private Long quantity;
17-
@Expose @SerializedName("$iata_carrier_code") private String iataCarrierCode;
1817
@Expose @SerializedName("$guests") private List<Guest> guests;
1918
@Expose @SerializedName("$segments") private List<Segment> segments;
2019
@Expose @SerializedName("$room_type") private String roomType;
@@ -96,15 +95,6 @@ public Booking setQuantity(Long quantity) {
9695
return this;
9796
}
9897

99-
public String getIataCarrierCode() {
100-
return iataCarrierCode;
101-
}
102-
103-
public Booking setIataCarrierCode(String iataCarrierCode) {
104-
this.iataCarrierCode = iataCarrierCode;
105-
return this;
106-
}
107-
10898
public List<Guest> getGuests() {
10999
return guests;
110100
}

src/main/java/com/siftscience/model/CreateAccountFieldSet.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,12 @@ public static CreateAccountFieldSet fromJson(String json) {
1111
}
1212

1313
@Expose @SerializedName("$account_types") private List<String> accountTypes;
14-
@Expose @SerializedName("$promotions") private List<Promotion> promotions;
1514

1615
@Override
1716
public String getEventType() {
1817
return "$create_account";
1918
}
2019

21-
public List<Promotion> getPromotions() {
22-
return promotions;
23-
}
24-
25-
public CreateAccountFieldSet setPromotions(List<Promotion> promotions) {
26-
this.promotions = promotions;
27-
return this;
28-
}
29-
3020
public List<String> getAccountTypes() { return accountTypes; }
3121

3222
public CreateAccountFieldSet setAccountTypes(List<String> accountTypes) {

src/main/java/com/siftscience/model/Segment.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ public class Segment {
1212
@Expose @SerializedName("$arrival_airport_code") private String arrivalAirportCode;
1313
@Expose @SerializedName("$departure_airport_code") private String departureAirportCode;
1414
@Expose @SerializedName("$fare_class") private String fareClass;
15+
@Expose @SerializedName("$iata_carrier_code") private String iataCarrierCode;
1516

1617

1718
public Address getDepartureAddress() {
@@ -85,4 +86,21 @@ public Segment setFareClass(String fareClass) {
8586
this.fareClass = fareClass;
8687
return this;
8788
}
89+
90+
public String getIataCarrierCode() {
91+
return iataCarrierCode;
92+
}
93+
94+
/**
95+
* Sets the IATA carrier code for the flight segment.
96+
*
97+
* <p>This field should only be set when the booking type is {@code $flight}.</p>
98+
*
99+
* @param iataCarrierCode The IATA carrier code.
100+
* @return The updated {@code Segment} object.
101+
*/
102+
public Segment setIataCarrierCode(String iataCarrierCode) {
103+
this.iataCarrierCode = iataCarrierCode;
104+
return this;
105+
}
88106
}

src/test/java/com/siftscience/CreateOrderEventTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,12 @@ public void testCreateOrderEventWithBookings() throws JSONException, IOException
124124
" \"$vessel_number\": \"LH454\",\n" +
125125
" \"$fare_class\": \"Premium Economy\",\n" +
126126
" \"$departure_airport_code\": \"SFO\",\n" +
127-
" \"$arrival_airport_code\": \"LAS\"\n" +
127+
" \"$arrival_airport_code\": \"LAS\",\n" +
128+
" \"$iata_carrier_code\": \"AS\"\n" +
128129
" }\n" +
129130
" ],\n" +
130131
" \"$price\": 49900000,\n" +
131132
" \"$currency_code\": \"USD\",\n" +
132-
" \"$iata_carrier_code\": \"AS\",\n" +
133133
" \"$quantity\": 1,\n" +
134134
" \"$tags\": [\n" +
135135
" \"team-123\",\n" +

src/test/java/com/siftscience/SiftRequestTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public void testUserAgentHeader() throws Exception {
2929

3030
// then
3131
RecordedRequest recordedRequest = server.takeRequest();
32-
assertEquals("SiftScience/v205 sift-java/3.19.0",
32+
assertEquals("SiftScience/v205 sift-java/3.20.0",
3333
recordedRequest.getHeader("User-Agent"));
3434
}
3535

0 commit comments

Comments
 (0)