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
5 changes: 0 additions & 5 deletions .circleci/maven-release-settings.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<!-- <server>
<id>ossrh</id>
<username>${env.SERVER_OSSRH_USERNAME}</username>
<password>${env.SERVER_OSSRH_PASSWORD}</password>
</server> -->
<server>
<id>central</id>
<username>${env.MAVEN_CENTRAL_USERNAME}</username>
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Riskified JAVA SDK
=================

version: 2.3.2
version: 3.3.0
------------------

See http://apiref.riskified.com for full API documentation
Expand Down Expand Up @@ -104,6 +104,7 @@ curl -H "Content-Type: application/json" -H "X-RISKIFIED-HMAC-SHA256: 071ef80d5
<dependency>
<groupId>com.riskified</groupId>
<artifactId>riskified-sdk</artifactId>
<version>v2.3.0</version>
<version>v3.3.0</version>
</dependency>
```

14 changes: 2 additions & 12 deletions 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>v3.2.0</version>
<version>v3.3.0</version>
<name>Riskified SDK</name>
<description>Riskified rest api SDK for java</description>
<url>https://www.riskified.com</url>
Expand Down Expand Up @@ -36,24 +36,14 @@
</configuration>
</plugin>

<!-- <plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.3</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin> -->
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.8.0</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
<autoPublish>true</autoPublish>
</configuration>
</plugin>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,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/3.2.0"); // TODO: take the version automatically
postRequest.setHeader("User-Agent","riskified_java_sdk/3.3.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 @@ -6,6 +6,8 @@ public class BankWirePaymentDetails implements IPaymentDetails {
private String accountNumber;
private String routingNumber;
private String token;
private Date storedPaymentCreatedAt;
private Date storedPaymentUpdatedAt;

public BankWirePaymentDetails(String accountNumber, String routingNumber) {
this.accountNumber = accountNumber;
Expand Down Expand Up @@ -36,6 +38,22 @@ public void setToken(String token){
this.token = token;
}

public Date getStoredPaymentCreatedAt(){
return self.storedPaymentCreatedAt;
}

public void setStoredPaymentCreatedAt(Date storedPaymentCreatedAt){
this.token = storedPaymentCreatedAt;
}

public Date getStoredPaymentUpdateddAt(){
return self.storedPaymentUpdatedAt;
}

public void setStoredPaymentUpdateddAt(Date storedPaymentUpdatedAt){
this.token = storedPaymentUpdatedAt;
}

public void validate(Validation validationType) throws FieldBadFormatException {
if (validationType == Validation.ALL) {
Validate.notNullOrEmpty(this, this.accountNumber, "Bank Account Number");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public class Recipient implements IValidated {
private Date createdAt;
private Date updatedAt;
private boolean selfRecipient;
private String walletId;

public Recipient() {
}
Expand Down Expand Up @@ -79,4 +80,12 @@ public boolean isSelfRecipient() {
public void setSelfRecipient(boolean selfRecipient) {
this.selfRecipient = selfRecipient;
}

public String getWalletId(){
return self.walletId;
}

public void setWalletId(String walletId){
self.walletId = walletId
}
}
36 changes: 36 additions & 0 deletions riskified-sdk/src/main/java/com/riskified/models/ResOrder.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package com.riskified.models;

import com.google.gson.annotations.SerializedName;

import java.util.Map;

public class ResOrder {

private String id;
Expand All @@ -16,6 +20,9 @@ public class ResOrder {
private Double riskScore;
private PolicyProtect policyProtect;

@SerializedName("risk_indicators")
private Map<String, Object> riskIndicatorsMap;


public String getId() {
return id;
Expand Down Expand Up @@ -113,4 +120,33 @@ public void setPolicyProtect(PolicyProtect policyProtect) {
this.policyProtect = policyProtect;
}


public Map<String, Object> getRiskIndicatorsMap() {
return riskIndicatorsMap;
}

public void setRiskIndicatorsMap(Map<String, Object> riskIndicatorsMap) {
this.riskIndicatorsMap = riskIndicatorsMap;
}

// Convenience method to get as RiskIndicators object
public RiskIndicators getRiskIndicators() {
if (riskIndicatorsMap == null || riskIndicatorsMap.isEmpty()) {
return null;
}

RiskIndicators ri = new RiskIndicators();
riskIndicatorsMap.forEach(ri::set);
return ri;
}

// Convenience method to set from RiskIndicators object
public void setRiskIndicators(RiskIndicators riskIndicators) {
if (riskIndicators == null) {
this.riskIndicatorsMap = null;
} else {
this.riskIndicatorsMap = riskIndicators.getAllProperties();
}
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package com.riskified.models;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class RiskIndicators {
private final Map<String, Object> properties = new HashMap<>();

// Generic setter - accepts any field name and value
public RiskIndicators set(String fieldName, Object value) {
properties.put(fieldName, value);
return this;
}

// Generic getter with type casting
@SuppressWarnings("unchecked")
public <T> T get(String fieldName, Class<T> type) {
Object value = properties.get(fieldName);
if (value == null) return null;
return (T) value;
}

// Simple getter (returns Object)
public Object get(String fieldName) {
return properties.get(fieldName);
}

// Check if field exists
public boolean has(String fieldName) {
return properties.containsKey(fieldName);
}

// Get all defined fields
public Set<String> getFields() {
return properties.keySet();
}

// Remove field
public RiskIndicators remove(String fieldName) {
properties.remove(fieldName);
return this;
}

// Get all properties
public Map<String, Object> getAllProperties() {
return new HashMap<>(properties);
}

@Override
public String toString() {
return "RiskIndicators" + properties;
}
}

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.riskified.notifications;

import com.riskified.models.Context;
import com.riskified.models.Custom;
import com.riskified.models.PolicyProtect;
import com.riskified.models.RecoveryEligibility;
import com.google.gson.annotations.SerializedName;
import com.riskified.models.*;

import java.util.Map;

// Shop URL may also be added to the API notifications from Riskified depending on your
// account configuration (contact your Account Manager or Integration Engineer for details).
Expand Down Expand Up @@ -34,6 +34,8 @@ public static class NotificationOrder {
private Context context;
private String[] decision_reasons;
private PolicyProtect policyProtect;
@SerializedName("risk_indicators")
private Map<String, Object> riskIndicatorsMap;

public String getId() {
return id;
Expand Down Expand Up @@ -113,5 +115,33 @@ public PolicyProtect getPolicyProtect() {
return policyProtect;
}
public void setPolicyProtect(PolicyProtect policyProtect) {}

public Map<String, Object> getRiskIndicatorsMap() {
return riskIndicatorsMap;
}

public void setRiskIndicatorsMap(Map<String, Object> riskIndicatorsMap) {
this.riskIndicatorsMap = riskIndicatorsMap;
}

// Convenience method to get as RiskIndicators object
public RiskIndicators getRiskIndicators() {
if (riskIndicatorsMap == null || riskIndicatorsMap.isEmpty()) {
return null;
}

RiskIndicators ri = new RiskIndicators();
riskIndicatorsMap.forEach(ri::set);
return ri;
}

// Convenience method to set from RiskIndicators object
public void setRiskIndicators(RiskIndicators riskIndicators) {
if (riskIndicators == null) {
this.riskIndicatorsMap = null;
} else {
this.riskIndicatorsMap = riskIndicators.getAllProperties();
}
}
}
}
Loading