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
2 changes: 1 addition & 1 deletion riskified-sdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.riskified</groupId>
<artifactId>riskified-sdk</artifactId>
<version>v2.13-score</version>
<version>v2.14.0</version>
<name>Riskified SDK</name>
<description>Riskified rest api SDK for java</description>
<url>https://www.riskified.com</url>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,7 @@ private HttpPost createPostRequest(String url) {
postRequest.setHeader(HttpHeaders.ACCEPT, "application/vnd.riskified.com; version=2");
postRequest.setHeader(HttpHeaders.ACCEPT, "application/json");
postRequest.setHeader("X-RISKIFIED-SHOP-DOMAIN", shopUrl);
postRequest.setHeader("User-Agent","riskified_java_sdk/2.13-score"); // TODO: take the version automatically
postRequest.setHeader("User-Agent","riskified_java_sdk/2.14.0"); // TODO: take the version automatically
postRequest.setHeader("Version",versionHeaderValue);
return postRequest;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ public class CreditCardPaymentDetails implements IPaymentDetails {
private AuthorizationType authorizationType;
private String creditCardCountry;
private String acquirerRegion;
private Integer expiryMonth;
private Integer expiryYear;


public CreditCardPaymentDetails(String creditCardBin,
Expand All @@ -51,11 +53,21 @@ public void validate(Validation validationType) throws FieldBadFormatException {
if (this.acquirerRegion != null && (this.acquirerRegion != "EU" && this.acquirerRegion != "NONEU")) {
throw new FieldBadFormatException("Acquirer Region must be 'EU' or 'NONEU'");
}
if (this.expiryMonth != null) {
if (this.expiryMonth < 1 || this.expiryMonth > 12) {
throw new FieldBadFormatException("Expiry Month must be between 01 and 12");
}
}

// Validate expiryYear is a 4-digit integer greater than or equal to the current year
if (this.expiryYear != null) {
if (this.expiryYear < 1900 || this.expiryYear > 9999) {
throw new FieldBadFormatException("Expiry Year must be a 4-digit integer formatted as YYYY");
}
}



// Validate.notNullOrEmpty(this, this.acquirerBin, "acquirer Bin");
// Validate.notNullOrEmpty(this, this.gateway, "gateway");


}
}

Expand Down Expand Up @@ -205,4 +217,12 @@ public void setMid(String mid) {

public void setAcquirerRegion(String acquirerRegion) { this.acquirerRegion = acquirerRegion; }

public Integer getExpiryMonth() { return expiryMonth; }

public void setExpiryMonth(Integer expiryMonth) { this.expiryMonth = expiryMonth; }

public Integer getExpiryYear() { return expiryYear; }

public void setExpiryYear(Integer expiryYear) { this.expiryYear = expiryYear; }

}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public class Customer implements IValidated {
private Boolean verifiedPhone;
private Date verifiedPhoneAt;
private String userName;
private Boolean kycVerified;

public Customer() {

Expand Down Expand Up @@ -259,4 +260,10 @@ public Integer getLinkedAccounts() {
public String getUserName() { return userName; }

public void setUserName(String userName) { this.userName = userName; }

public Boolean getKycVerified() { return kycVerified; }

public void setKycVerified(Boolean kycVerified) {
this.kycVerified = kycVerified;
}
}
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
package com.riskified.models;

public class DigitalLineItem extends LineItem {

// Giftcard industry fields
String senderName;
String displayName;
Boolean photoUploaded;
String photoUrl;
String greetingPhotoUrl;
String message;
String greetingMessage;
String cardType;
String cardSubType;
String senderEmail;
Recipient recipient;
String displayName;
Boolean photoUploaded;
String photoUrl;
String greetingPhotoUrl;
String message;
String greetingMessage;
String cardType;
String cardSubType;
String senderEmail;
Recipient digitalRecipient;

public DigitalLineItem(double price, int quantity, String title, Recipient recipient) {
super(price, quantity, title);
this.recipient = recipient;
if (recipient == null) {
throw new IllegalArgumentException("Recipient is required for DigitalLineItem");
}
this.digitalRecipient = recipient;
}

public String getSenderName() {
Expand Down Expand Up @@ -101,10 +104,13 @@ public void setSenderEmail(String senderEmail) {
}

public Recipient getRecipient() {
return recipient;
return digitalRecipient;
}

public void setRecipient(Recipient recipient) {
this.recipient = recipient;
this.digitalRecipient = recipient;
}

}


26 changes: 26 additions & 0 deletions riskified-sdk/src/main/java/com/riskified/models/LineItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ public class LineItem implements IValidated {
private String color;
private RegistryType registryType;
private Policy policy;
private String routingNumber;
private String accountNumber;
private String reasonToTransfer;


public LineItem(double price, int quantity, String title) {
Expand Down Expand Up @@ -309,6 +312,29 @@ public void setPolicy(Policy policy) {
this.policy = policy;
}

public String getRoutingNumber() {
return routingNumber;
}

public void setRoutingNumber(String routingNumber) {
this.routingNumber = routingNumber;
}

public String getAccountNumber() {
return accountNumber;
}

public void setAccountNumber(String accountNumber) {
this.accountNumber = accountNumber;
}

public String getReasonToTransfer(){
return reasonToTransfer;
}

public void setReasonToTransfer(String reasonToTransfer) {
this.reasonToTransfer = reasonToTransfer;
}



Expand Down
40 changes: 40 additions & 0 deletions riskified-sdk/src/main/java/com/riskified/models/Recipient.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,18 @@

import com.riskified.validations.*;

import java.util.Date;

public class Recipient implements IValidated {

String email;
String phone;
SocialDetails social;
private String accountNumber;
private String routingNumber;
private Date createdAt;
private Date updatedAt;
private boolean selfRecipient;

public Recipient() {
}
Expand Down Expand Up @@ -39,4 +46,37 @@ public void setSocial(SocialDetails social) {
this.social = social;
}

public String getAccountNumber() {
return accountNumber;
}
public void setAccountNumber(String accountNumber) {
this.accountNumber = accountNumber;
}
public String getRoutingNumber() {
return routingNumber;
}
public void setRoutingNumber(String routingNumber) {
this.routingNumber = routingNumber;
}

public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdatedAt(){
return updatedAt;
}
public void setUpdatedAt(Date updatedAt){
this.updatedAt = updatedAt;
}

public boolean isSelfRecipient() {
return selfRecipient;
}

public void setSelfRecipient(boolean selfRecipient) {
this.selfRecipient = selfRecipient;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ public class TravelLineItem extends LineItem {

private int routeIndex;
private int legIndex;

private String departurePortCode;
private String arrivalPortCode;
private Date departureDate;
Expand All @@ -22,7 +21,7 @@ public class TravelLineItem extends LineItem {
private String carrierName;
private String carrierCode;
private String transportMethod;
private Recipient recipient;
//private Recipient recipient;

public TravelLineItem(double price, int quantity, String title,
String legId, int legIndex, int routeIndex) {
Expand Down Expand Up @@ -193,13 +192,13 @@ public void setTransportMethod(String transportMethod) {
this.transportMethod = transportMethod;
}

public Recipient getRecipient() {
return recipient;
}

public void setRecipient(Recipient recipient) {
this.recipient = recipient;
}
// public Recipient getRecipient() {
// return recipient;
// }
//
// public void setRecipient(Recipient recipient) {
// this.recipient = recipient;
// }


}