Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
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
83 changes: 59 additions & 24 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,82 @@
version: 2.0
jobs:
build:
version: 2.1

orbs:
git-shallow-clone: riskified/git-shallow-clone@2.8.0

executors:
java-executor:
resource_class: riskified/container-agent
docker:
- image: 284309667046.dkr.ecr.us-east-1.amazonaws.com/riskified/images-library/openjdk-cimg:master-8.0
- image: 284309667046.dkr.ecr.us-east-1.amazonaws.com/riskified/images-library/openjdk-cimg:master-21.0

working_directory: ~/repo
jobs:
package:
executor: java-executor
working_directory: ~/RiskifiedJavaSDK
steps:
- checkout

# Download and cache dependencies
- run:
name: Avoid hosts unknown for github
command: mkdir -p ~/.ssh/ && echo -e "Host github.com\n\tStrictHostKeyChecking no\n" > ~/.ssh/config
- git-shallow-clone/checkout:
depth: 1
- restore_cache:
keys:
- v1-dependencies-{{ checksum "pom.xml" }}
- v1-dependencies-
- run: mvn dependency:go-offline

- v1-dependencies-{{ checksum "pom.xml" }}
- v1-dependencies-
- run:
command: mvn dependency:go-offline
- save_cache:
paths:
- ~/.m2
key: v1-dependencies-{{ checksum "pom.xml" }}
- run:
command: |
echo $SERVER_OSSRH_USERNAME
- run:
- run:
name: Build project with Maven
command: mvn -B package --file pom.xml
deploy:
executor: java-executor
working_directory: ~/RiskifiedJavaSDK
steps:
- run:
name: Avoid hosts unknown for github
command: mkdir -p ~/.ssh/ && echo -e "Host github.com\n\tStrictHostKeyChecking no\n" > ~/.ssh/config
- run:
name: "Configure GPG"
command: |
mkdir -p ~/.gnupg
echo use-agent >> ~/.gnupg/gpg.conf
echo pinentry-mode loopback >> ~/.gnupg/gpg.conf
echo allow-loopback-pinentry >> ~/.gnupg/gpg-agent.conf
echo RELOADAGENT | gpg-connect-agent
gpg-connect-agent reloadagent /bye
echo $SECRING_GPG_ASC_BASE64 | base64 --decode | gpg --batch --no-tty --import --yes
GPG_TTY=$(tty)
export GPG_TTY
- restore_cache:
keys:
- v1-dependencies-{{ checksum "pom.xml" }}
- v1-dependencies-
- run:
command: |
mvn -s .circleci/maven-release-settings.xml clean deploy -DdeployAtEnd=true -DperformRelease=true -DskipTests -Dspotbugs.skip=true

command: mvn -s .circleci/maven-release-settings.xml clean deploy -DdeployAtEnd=true -DperformRelease=true -DskipTests -Dspotbugs.skip=true

workflows:
version: 2
main:
jobs:
- build:
- package:
filters:
tags:
only: /^v.*/
- hold_on_deploy:
type: approval
requires:
- package
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/
- deploy:
requires:
- hold_on_deploy
filters:
tags:
only: /^v.*/
branches:
only: [master, /release-.*/]
ignore: /.*/
50 changes: 0 additions & 50 deletions .github/workflows/main.yml

This file was deleted.

22 changes: 0 additions & 22 deletions .github/workflows/maven-release-setting.xml

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Riskified JAVA SDK
=================

version: 3.3.0
version: 5.1.0
------------------

See http://apiref.riskified.com for full API documentation
Expand Down Expand Up @@ -45,7 +45,7 @@ Prerequisites:

---------------

* Java JDK-1.5 or higher
* Java JDK-8 or higher

Running the samples:

Expand Down Expand Up @@ -104,7 +104,7 @@ curl -H "Content-Type: application/json" -H "X-RISKIFIED-HMAC-SHA256: 071ef80d5
<dependency>
<groupId>com.riskified</groupId>
<artifactId>riskified-sdk</artifactId>
<version>v3.3.0</version>
<version>v5.1.0</version>
</dependency>
```

5 changes: 2 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<version>3.14.1</version>
<configuration>
<source/>
<target/>
<release>8</release>
</configuration>
</plugin>
</plugins>
Expand Down
2 changes: 1 addition & 1 deletion riskified-sample/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<dependency>
<groupId>com.riskified</groupId>
<artifactId>riskified-sdk</artifactId>
<version>v2.2.2</version>
<version>v5.1.0</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ public static void main(String[] arg) throws FieldBadFormatException {
try {
// Riskified client parameters can be set in the constructor, like this:
RiskifiedClient client = new RiskifiedClient("<shop_url>", "<auth_token>", Environment.SANDBOX);
// Or according 'riskified_sdk.properties' configuration file, like this:
// Or using 'riskified_sdk.properties' configuration file, like this:
//RiskifiedClient client = new RiskifiedClient();

Response resCreateOrder = client.createOrder(order);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,9 @@ private static Contact generateContact() {
}

private static Verification generateVerification() {
Verification verification = new Verification(new Date(2020,06,25,13,53,19), VerificationStatus.success, "12345");
Calendar cal = Calendar.getInstance();
cal.set(2020, Calendar.JUNE, 25, 13, 53, 19);
Verification verification = new Verification(cal.getTime(), VerificationStatus.success, "12345", "555-625-1199");
verification.setEmail("customer_email@test.com");
VerificationSessionDetails verificationSessionDetails = new VerificationSessionDetails();
verificationSessionDetails.setBrowserIp("111.111.111.111");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ public static void main(String[] arg) throws FieldBadFormatException, ParseExcep

try {
// Riskified client parameters can be set in the constructor, like this:
RiskifiedClient client = new RiskifiedClient("shopurl", "authtoken", Environment.SANDBOX);
RiskifiedClient client = new RiskifiedClient("shopurl", "authtoken", Environment.SANDBOX);
// Or using 'riskified_sdk.properties' configuration file, like this:
//RiskifiedClient client = new RiskifiedClient();


// Response resAdviseOrder = client.adviseOrder(adviseOrder);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static void main(String[] args) throws ParseException, FileNotFoundExcept
billingAddress.setCountryCode("US");
billingAddress.setProvinceCode("NY");
billingAddress.setZip("64155");
order.setBillingAddress(billingAddress);
order.setBillingAddress(Collections.singletonList(billingAddress));



Expand Down
15 changes: 5 additions & 10 deletions riskified-sdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,12 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.riskified</groupId>
<artifactId>riskified-sdk</artifactId>
<version>v4.1.0</version>
<version>v5.1.0</version>
<name>Riskified SDK</name>
<description>Riskified rest api SDK for java</description>
<url>https://www.riskified.com</url>

<distributionManagement>
<!-- <snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository> -->
<snapshotRepository>
<id>central</id>
<url>https://central.sonatype.com/api/v1/publisher/deployments/</url>
Expand All @@ -29,17 +25,16 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<version>3.14.1</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
<release>8</release>
</configuration>
</plugin>

<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.8.0</version>
<version>0.10.0</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
Expand Down Expand Up @@ -68,7 +63,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9</version>
<version>3.6.3</version>
<executions>
<execution>
<id>attach-javadocs</id>
Expand Down
2 changes: 0 additions & 2 deletions riskified-sdk/src/main/java/com/riskified/JSONFormater.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
import com.riskified.models.PaypalPaymentDetails;
import com.riskified.models.StripePaymentDetails;

import sun.security.x509.IPAddressName;

public class JSONFormater {

public static String toJson(Object obj) {
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/4.1.0"); // TODO: take the version automatically
postRequest.setHeader("User-Agent","riskified_java_sdk/5.1.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 @@ -93,7 +93,7 @@
* Both the type field name ({@code "type"}) and the type labels ({@code
* "Rectangle"}) are configurable.
*
* <h3>Registering Types</h3>
* <h2>Registering Types</h2>
* Create a {@code RuntimeTypeAdapterFactory} by passing the base type and type field
* name to the {@link #of} factory method. If you don't supply an explicit type
* field name, {@code "type"} will be used. <pre> {@code
Expand Down