Skip to content
No description, website, or topics provided.
Java
Branch: master
Clone or download

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci Update config.yml Mar 30, 2020
riskified-sample Merge branch 'master' into screen Apr 1, 2020
riskified-sdk Merge branch 'master' into screen Apr 1, 2020
.gitignore Add advise endpoint as well as converted payment details to an array May 29, 2019
LICENSE.md Add license Feb 21, 2020
README.md Update README.md Jan 12, 2017
pom.xml fix javadoc errors Oct 19, 2018

README.md

Riskified JAVA SDK

See http://apiref.riskified.com for full API documentation

See riskified-sample/ for examples on how to use this SDK.

Data validation:

The SDK includes a validation mechanism to help you catch formatting and data issues quickly. However, it is possible to control the level of validation, through the SDKs Validation object, which is the forth parameter in the SDK's RiskifiedClient constructor. For example, you can tell the Validation engine to ignore missing values, by passing the constructor the Validations.ignoreMissing

like this:

RiskifiedClient client = new RiskifiedClient(domain, authToken, Environment.SANDBOX, Validation.IGNORE_MISSING);

Or specify the validation type in the config file 'riskified_sdk.properties'.

Available validation types:

  • none - disable validations
  • ignoreMissing - validates only the data format
  • all - validates the data format and that required fields are not missing

Prerequisites:

  • Java JDK-1.5 or higher

Running the samples:

  • Build the SDK - Run mvn package which will build both the SDK and the samples
  • Configure your properties (authKey and shopUrl) - in the riskified-sdk/src/main/resources/riskified_sdk.properties file. Your Riskified's authorization token (authKey) can be found in the advanced settings section of your Riskified sandbox environment.

Simple order creation sample

This samples shows how to construct an Order model and invoke the basic api/create endpoint

cd riskified-sample
mvn exec:java -Dexec.mainClass="com.riskified.samples.orderClient.SimpleClient"

Client sample

This samples shows how to construct an Order model and invoke each and every one of our endpoints with it

cd riskified-sample
mvn exec:java -Dexec.mainClass="com.riskified.samples.orderClient.Client"

Json Client sample

This samples shows how to construct an Order model and save it locally as a Json file, this sample is useful for early stages of the integration and for POCs

cd riskified-sample
mvn exec:java -Dexec.mainClass="com.riskified.samples.orderClient.JsonClient"

Notifications sample

This samples shows how to bring up a notification end point

cd riskified-sample
mvn exec:java -Dexec.mainClass="com.riskified.samples.notificationServer.servlet.SampleServer"

Then you can test the endpoint by running a curl command from another terminal

curl -H "Content-Type: application/json" -H  "X-RISKIFIED-HMAC-SHA256: 071ef80d5790011d2f111479b75eed15e907432a4523defb4e627c6725d3b6b3" -X POST -d '{"order":{"id":"123","status":"approved","old_status":"submitted","description":"Approved by Riskified"}}' http://localhost:8080

Maven dependency excerpt:

<dependency>
	<groupId>com.riskified</groupId>
	<artifactId>riskified-sdk</artifactId>
	<version>1.0.2.9</version>
</dependency>
You can’t perform that action at this time.