Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGES.MD
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
3.6.1 (2022-08-18)
=================
- Added $verification_phone_number to $add_item_to_cart, $add_promotion, $content_status, $create_account, $create_content, $create_order, $custom_event, $flag_content, $login, $remove_item_from_cart, $transaction, $update_account, $update_content, $update_order, and $update_password events

3.5.2 (2022-07-27)
=================
- Added SiftClient constructor to override the baseUrl
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.5.2</version>
<version>3.6.1</version>
</dependency>
```
### Gradle
```
dependencies {
compile 'com.siftscience:sift-java:3.5.2'
compile 'com.siftscience:sift-java:3.6.1'
}
```
### 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.5.2'
version = '3.6.1'

repositories {
mavenCentral()
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/siftscience/FieldSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public abstract class FieldSet<T extends FieldSet<T>> {
public static final String IS_BAD = "$is_bad";
public static final String ABUSE_TYPE = "$abuse_type";
public static final String KEYLESS_USER_ID = "$keyless_user_id";
public static final String VERIFICATION_PHONE_NUMBER = "$verification_phone_number";

// Serialization happens in two stages. First, the object is serialized with `defaultGson`
// according to the @Expose and @SerializedName annotations on the subclass type. Then, the
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/com/siftscience/model/AddItemToCartFieldSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public static AddItemToCartFieldSet fromJson(String json) {
}

@Expose @SerializedName("$item") private Item item;
@Expose @SerializedName(VERIFICATION_PHONE_NUMBER) private String verificationPhoneNumber;

@Override
public String getEventType() {
Expand All @@ -23,4 +24,13 @@ public AddItemToCartFieldSet setItem(Item item) {
this.item = item;
return this;
}

public String getVerificationPhoneNumber() {
return verificationPhoneNumber;
}

public AddItemToCartFieldSet setVerificationPhoneNumber(String verificationPhoneNumber) {
this.verificationPhoneNumber = verificationPhoneNumber;
return this;
}
}
10 changes: 10 additions & 0 deletions src/main/java/com/siftscience/model/AddPromotionFieldSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public static AddPromotionFieldSet fromJson(String json) {
}

@Expose @SerializedName("$promotions") private List<Promotion> promotions;
@Expose @SerializedName(VERIFICATION_PHONE_NUMBER) private String verificationPhoneNumber;

@Override
public String getEventType() {
Expand All @@ -25,4 +26,13 @@ public AddPromotionFieldSet setPromotions(List<Promotion> promotions) {
this.promotions = promotions;
return this;
}

public String getVerificationPhoneNumber() {
return verificationPhoneNumber;
}

public AddPromotionFieldSet setVerificationPhoneNumber(String verificationPhoneNumber) {
this.verificationPhoneNumber = verificationPhoneNumber;
return this;
}
}
10 changes: 10 additions & 0 deletions src/main/java/com/siftscience/model/BaseAccountFieldSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public abstract class BaseAccountFieldSet<T extends BaseAccountFieldSet<T>>
@Expose @SerializedName("$shipping_address") private Address shippingAddress;
@Expose @SerializedName("$social_sign_on_type") private String socialSignOnType;
@Expose @SerializedName("$merchant_profile") private MerchantProfile merchantProfile;
@Expose @SerializedName(VERIFICATION_PHONE_NUMBER) private String verificationPhoneNumber;

public String getUserEmail() {
return userEmail;
Expand Down Expand Up @@ -97,4 +98,13 @@ public T setMerchantProfile(MerchantProfile merchantProfile) {
this.merchantProfile = merchantProfile;
return (T) this;
}

public String getVerificationPhoneNumber() {
return verificationPhoneNumber;
}

public T setVerificationPhoneNumber(String verificationPhoneNumber) {
this.verificationPhoneNumber = verificationPhoneNumber;
return (T) this;
}
}
10 changes: 10 additions & 0 deletions src/main/java/com/siftscience/model/BaseContentFieldSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public abstract class BaseContentFieldSet<T extends BaseContentFieldSet<T>>
extends BaseAppBrowserSiteBrandFieldSet<T> {
@Expose @SerializedName("$content_id") private String contentId;
@Expose @SerializedName("$status") private String status;
@Expose @SerializedName(VERIFICATION_PHONE_NUMBER) private String verificationPhoneNumber;

public String getContentId() {
return contentId;
Expand All @@ -25,4 +26,13 @@ public T setStatus(String status) {
this.status = status;
return (T) this;
}

public String getVerificationPhoneNumber() {
return verificationPhoneNumber;
}

public T setVerificationPhoneNumber(String verificationPhoneNumber) {
this.verificationPhoneNumber = verificationPhoneNumber;
return (T) this;
}
}
10 changes: 10 additions & 0 deletions src/main/java/com/siftscience/model/BaseOrderFieldSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public abstract class BaseOrderFieldSet<T extends BaseOrderFieldSet<T>>
@Expose @SerializedName("$bookings") private List<Booking> bookings;
@Expose @SerializedName("$ordered_from") private OrderedFrom orderedFrom;
@Expose @SerializedName("$merchant_profile") private MerchantProfile merchantProfile;
@Expose @SerializedName(VERIFICATION_PHONE_NUMBER) private String verificationPhoneNumber;

public String getOrderId() {
return orderId;
Expand Down Expand Up @@ -161,4 +162,13 @@ public T setMerchantProfile(MerchantProfile merchantProfile) {
this.merchantProfile = merchantProfile;
return (T) this;
}

public String getVerificationPhoneNumber() {
return verificationPhoneNumber;
}

public T setVerificationPhoneNumber(String verificationPhoneNumber) {
this.verificationPhoneNumber = verificationPhoneNumber;
return (T) this;
}
}
11 changes: 10 additions & 1 deletion src/main/java/com/siftscience/model/ContentStatusFieldSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public static ContentStatusFieldSet fromJson(String json) {

@Expose @SerializedName("$content_id") private String contentId;
@Expose @SerializedName("$status") private String status;
@Expose @SerializedName(VERIFICATION_PHONE_NUMBER) private String verificationPhoneNumber;

@Override
public String getEventType() {
Expand All @@ -25,7 +26,6 @@ public ContentStatusFieldSet setStatus(String status) {
return this;
}


public String getContentId() {
return contentId;
}
Expand All @@ -34,4 +34,13 @@ public ContentStatusFieldSet setContentId(String contentId) {
this.contentId = contentId;
return this;
}

public String getVerificationPhoneNumber() {
return verificationPhoneNumber;
}

public ContentStatusFieldSet setVerificationPhoneNumber(String verificationPhoneNumber) {
this.verificationPhoneNumber = verificationPhoneNumber;
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

public abstract class CreateContentFieldSet<T extends CreateContentFieldSet<T>>
extends BaseContentFieldSet<T> {

@Override
public String getEventType() {
return "$create_content";
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/com/siftscience/model/CustomEventFieldSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public static CustomEventFieldSet fromJson(String json) {
@Expose @SerializedName("$user_email") private String userEmail;
@Expose @SerializedName("$name") private String name;
@Expose @SerializedName("$phone") private String phone;
@Expose @SerializedName(VERIFICATION_PHONE_NUMBER) private String verificationPhoneNumber;

@Override
public String getEventType() {
Expand Down Expand Up @@ -49,4 +50,13 @@ public CustomEventFieldSet setPhone(String phone) {
this.phone = phone;
return this;
}

public String getVerificationPhoneNumber() {
return verificationPhoneNumber;
}

public CustomEventFieldSet setVerificationPhoneNumber(String verificationPhoneNumber) {
this.verificationPhoneNumber = verificationPhoneNumber;
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public abstract class EventsApiRequestFieldSet<T extends EventsApiRequestFieldSe
@Expose @SerializedName(SESSION_ID) private String sessionId;
@Expose @SerializedName(TIME) private Long time;
@Expose @SerializedName(IP) private String ip;
@Expose @SerializedName(KEYLESS_USER_ID) private String keyLessUserId;
@Expose @SerializedName(KEYLESS_USER_ID) private String keylessUserId;

public T setCustomField(String key, Number val) {
return super.setCustomField(key, val);
Expand Down Expand Up @@ -73,12 +73,12 @@ public T setIp(String ip) {
return (T) this;
}

public String getKeyLessUserId() {
return keyLessUserId;
public String getKeylessUserId() {
return keylessUserId;
}

public T setKeyLessUserId(String keylessUserId) {
this.keyLessUserId = keylessUserId;
public T setKeylessUserId(String keylessUserId) {
this.keylessUserId = keylessUserId;
return (T) this;
}
}
10 changes: 10 additions & 0 deletions src/main/java/com/siftscience/model/FlagContentFieldSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public static FlagContentFieldSet fromJson(String json) {

@Expose @SerializedName("$content_id") private String contentId;
@Expose @SerializedName("$flagged_by") private String flaggedBy;
@Expose @SerializedName(VERIFICATION_PHONE_NUMBER) private String verificationPhoneNumber;

@Override
public String getEventType() {
Expand All @@ -33,4 +34,13 @@ public FlagContentFieldSet setFlaggedBy(String flaggedBy) {
this.flaggedBy = flaggedBy;
return this;
}

public String getVerificationPhoneNumber() {
return verificationPhoneNumber;
}

public FlagContentFieldSet setVerificationPhoneNumber(String verificationPhoneNumber) {
this.verificationPhoneNumber = verificationPhoneNumber;
return this;
}
}
10 changes: 10 additions & 0 deletions src/main/java/com/siftscience/model/LoginFieldSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public static LoginFieldSet fromJson(String json) {
@Expose @SerializedName("$social_sign_on_type") private String socialSignOnType;
@Expose @SerializedName("$account_types") private List<String> accountTypes;
@Expose @SerializedName("$user_email") private String userEmail;
@Expose @SerializedName(VERIFICATION_PHONE_NUMBER) private String verificationPhoneNumber;

@Override
public String getEventType() {
Expand Down Expand Up @@ -69,4 +70,13 @@ public LoginFieldSet setUserEmail(String userEmail) {
this.userEmail = userEmail;
return this;
}

public String getVerificationPhoneNumber() {
return verificationPhoneNumber;
}

public LoginFieldSet setVerificationPhoneNumber(String verificationPhoneNumber) {
this.verificationPhoneNumber = verificationPhoneNumber;
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public static RemoveItemFromCartFieldSet fromJson(String json) {
}

@Expose @SerializedName("$item") private Item item;
@Expose @SerializedName(VERIFICATION_PHONE_NUMBER) private String verificationPhoneNumber;

@Override
public String getEventType() {
Expand All @@ -23,4 +24,13 @@ public RemoveItemFromCartFieldSet setItem(Item item) {
this.item = item;
return this;
}

public String getVerificationPhoneNumber() {
return verificationPhoneNumber;
}

public RemoveItemFromCartFieldSet setVerificationPhoneNumber(String verificationPhoneNumber) {
this.verificationPhoneNumber = verificationPhoneNumber;
return this;
}
}
10 changes: 10 additions & 0 deletions src/main/java/com/siftscience/model/TransactionFieldSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class TransactionFieldSet extends BaseAppBrowserSiteBrandFieldSet<Transac
@Expose @SerializedName("$triggered_3ds") private String triggered3ds;
@Expose @SerializedName("$merchant_initiated_transaction")
private Boolean merchantInitiatedTransaction;
@Expose @SerializedName(VERIFICATION_PHONE_NUMBER) private String verificationPhoneNumber;


@Override
Expand Down Expand Up @@ -216,4 +217,13 @@ public TransactionFieldSet setMerchantInitiatedTransaction(
this.merchantInitiatedTransaction = merchantInitiatedTransaction;
return this;
}

public String getVerificationPhoneNumber() {
return verificationPhoneNumber;
}

public TransactionFieldSet setVerificationPhoneNumber(String verificationPhoneNumber) {
this.verificationPhoneNumber = verificationPhoneNumber;
return this;
}
}
10 changes: 10 additions & 0 deletions src/main/java/com/siftscience/model/UpdatePasswordFieldSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public static UpdatePasswordFieldSet fromJson(String json) {

@Expose @SerializedName("$reason") private String reason;
@Expose @SerializedName("$status") private String status;
@Expose @SerializedName(VERIFICATION_PHONE_NUMBER) private String verificationPhoneNumber;

@Override
public String getEventType() {
Expand All @@ -29,4 +30,13 @@ public UpdatePasswordFieldSet setStatus(String status) {
this.status = status;
return this;
}

public String getVerificationPhoneNumber() {
return verificationPhoneNumber;
}

public UpdatePasswordFieldSet setVerificationPhoneNumber(String verificationPhoneNumber) {
this.verificationPhoneNumber = verificationPhoneNumber;
return this;
}
}
6 changes: 4 additions & 2 deletions src/test/java/com/siftscience/AddItemToCartEventTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ public void testAddItemToCart() throws Exception {
" \"$tags\" : [\"Awesome\", \"Wintertime specials\"],\n" +
" \"$color\" : \"Texas Tea\",\n" +
" \"$quantity\" : 2\n" +
" }\n" +
" },\n" +
" \"$verification_phone_number\" : \"+12345678901\"\n" +
"}";

// Start a new mock server and enqueue a mock response.
Expand All @@ -59,7 +60,8 @@ public void testAddItemToCart() throws Exception {
SiftRequest request = client.buildRequest(new AddItemToCartFieldSet()
.setUserId("billy_jones_301")
.setSessionId("gigtleqddo84l8cm15qe4il")
.setItem(TestUtils.sampleItem2()));
.setItem(TestUtils.sampleItem2())
.setVerificationPhoneNumber("+12345678901"));

SiftResponse siftResponse = request.send();

Expand Down
6 changes: 4 additions & 2 deletions src/test/java/com/siftscience/AddPromotionEventTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ public void testAddPromotion() throws Exception {
" \"$currency_code\" : \"USD\"\n" +
" }\n" +
" }\n" +
" ]\n" +
" ],\n" +
" \"$verification_phone_number\" : \"+12345678901\"\n" +
"}";

// Start a new mock server and enqueue a mock response.
Expand Down Expand Up @@ -62,7 +63,8 @@ public void testAddPromotion() throws Exception {
// Build and execute the request against the mock server.
SiftRequest request = client.buildRequest(new AddPromotionFieldSet()
.setUserId("billy_jones_301")
.setPromotions(promotions));
.setPromotions(promotions)
.setVerificationPhoneNumber("+12345678901"));

SiftResponse siftResponse = request.send();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public void testSiteDomain() throws Exception {
.setTestField(DUMMY_TEST_FIELD)
.setUserId(DUMMY_USERID)
.setSiteDomain(siteDomain)
.setKeyLessUserId(keyLessUserId),
.setKeylessUserId(keyLessUserId),
String.format(REQUEST_BODY_TEMPLATE, ", \"$site_domain\" : \"sift.com\"," +
" \"$keyless_user_id\" : \"keylessUserId-123\" }\n")
);
Expand Down
Loading