Skip to content

Commit d2dc93a

Browse files
authored
test build (#157)
1 parent 19e57e9 commit d2dc93a

File tree

2 files changed

+39
-27
lines changed

2 files changed

+39
-27
lines changed

.github/workflows/main.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
11
name: Maven CI/CD
2-
32
on:
43
push:
54
branches:
65
- master
6+
pull_request:
7+
branches:
8+
- master
9+
workflow_dispatch:
710

811
jobs:
912
build_and_test:
10-
1113
runs-on: ubuntu-latest
12-
1314
steps:
1415
- name: Checking out
15-
uses: actions/checkout@v3 ##action to give our job access to code in our repo
16+
uses: actions/checkout@v4 ##action to give our job access to code in our repo
1617

1718
- name: Cache local mvn repo
18-
uses: actions/cache@v3
19+
uses: actions/cache@v4
1920
with:
2021
path: ~/.m2/repository
2122
key: v1-dependencies-{{ hashFiles('**/pom.xml') }}
2223
restore-keys: |
2324
v1-dependencies-
25+
2426
- run: mvn dependency:go-offline
2527

2628
- name: Configuring GPG key
@@ -29,9 +31,8 @@ jobs:
2931
env:
3032
GPG_SIGNING_KEY: ${{ secrets.SECRING_GPG_ASC_BASE64 }}
3133

32-
3334
- name: Set up JDK 8
34-
uses: actions/setup-java@v2 ##this action sets up a java environment that our job can run in
35+
uses: actions/setup-java@v4 ##this action sets up a java environment that our job can run in
3536
with:
3637
distribution: 'zulu'
3738
java-version: 8
@@ -41,6 +42,7 @@ jobs:
4142
run: mvn -B package --file pom.xml
4243

4344
- name: Publish to Apache Maven Central
45+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
4446
run: GPG_TTY=$(tty); mvn -s .github/workflows/maven-release-setting.xml clean deploy -DdeployAtEnd=true -DperformRelease=true -DskipTests -Dspotbugs.skip=true
4547
env:
4648
SERVER_OSSRH_USERNAME: ${{ secrets.SERVER_OSSRH_USERNAME }}

README.md

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ Riskified JAVA SDK
44
version: 2.3.2
55
------------------
66

7-
See http://apiref.riskified.com for full API documentation
7+
See http://apiref.riskified.com for full API documentation
88

9-
see riskified-sample/ for examples on how to use this SDK.
9+
see riskified-sample/ for examples on how to use this SDK.
1010

1111
Data validation:
12+
1213
---------------
1314
The SDK includes a validation mechanism to help you catch formatting and data issues quickly.
1415
However, it is possible to control the level of validation, through the SDKs Validation object,
@@ -17,48 +18,58 @@ For example, you can tell the Validation engine to ignore missing values, by pas
1718
Validations.ignoreMissing
1819

1920
like this:
20-
```
21+
22+
```text
2123
RiskifiedClient client = new RiskifiedClient(domain, authToken, Environment.SANDBOX, Validation.IGNORE_MISSING);
2224
```
25+
2326
Or specify the validation type in the config file 'riskified_sdk.properties'.
2427

25-
Available validation types:
26-
* none - disable validations
27-
* ignoreMissing - validates only the data format
28-
* all - validates the data format and that required fields are not missing
28+
Available validation types:
2929

30+
* none - disable validations
31+
* ignoreMissing - validates only the data format
32+
* all - validates the data format and that required fields are not missing
3033

3134
PSD2: Advise endpoint old response testing:
35+
3236
-------------------------------------------
3337
Riskified changed the /advice endpoint response. To enable the old response for testing purposes, follow steps below:
34-
1. Open riskified_sdk.properties file
35-
2. Set "enable_old_advise_response" to "true"
3638

37-
Riskified SDK will return the old advise response.
39+
1. Open riskified_sdk.properties file
40+
2. Set "enable_old_advise_response" to "true"
3841

42+
Riskified SDK will return the old advise response.
3943

4044
Prerequisites:
45+
4146
---------------
42-
* Java JDK-1.5 or higher
47+
48+
* Java JDK-1.5 or higher
4349

4450
Running the samples:
51+
4552
--------------------------
53+
4654
* **Build the SDK** - Run `mvn package` which will build both the SDK and the samples
47-
* **Configure your properties** (authKey and shopUrl) - in the riskified-sdk/src/main/resources/riskified_sdk.properties file.
48-
Your Riskified's authorization token (authKey) can be found in the [advanced settings section](https://sandbox.riskified.com/main/settings/advanced) of your Riskified sandbox environment.
55+
* **Configure your properties** (authKey and shopUrl) - in the riskified-sdk/src/main/resources/riskified_sdk.properties file.
56+
Your Riskified's authorization token (authKey) can be found in the [advanced settings section](https://sandbox.riskified.com/main/settings/advanced) of your Riskified sandbox environment.
4957

5058
## Simple order creation sample
59+
5160
This samples shows how to construct an Order model and invoke the basic api/create endpoint
5261

53-
```
62+
```shell
5463
cd riskified-sample
5564
mvn exec:java -Dexec.mainClass="com.riskified.samples.orderClient.SimpleClient"
5665
```
5766

58-
## Client sample
67+
Client sample
68+
===============
69+
5970
This samples shows how to construct an Order model and invoke each and every one of our endpoints with it
6071

61-
```
72+
```shell
6273
cd riskified-sample
6374
mvn exec:java -Dexec.mainClass="com.riskified.samples.orderClient.Client"
6475
```
@@ -67,7 +78,7 @@ mvn exec:java -Dexec.mainClass="com.riskified.samples.orderClient.Client"
6778

6879
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
6980

70-
```
81+
```shell
7182
cd riskified-sample
7283
mvn exec:java -Dexec.mainClass="com.riskified.samples.orderClient.JsonClient"
7384
```
@@ -80,13 +91,14 @@ This samples shows how to bring up a notification end point
8091
cd riskified-sample
8192
mvn exec:java -Dexec.mainClass="com.riskified.samples.notificationServer.servlet.SampleServer"
8293
```
94+
8395
Then you can test the endpoint by running a curl command from another terminal
8496

8597
```sh
8698
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
8799
```
88100

89-
## Maven dependency excerpt:
101+
## Maven dependency excerpt
90102

91103
```xml
92104
<dependency>
@@ -95,5 +107,3 @@ curl -H "Content-Type: application/json" -H "X-RISKIFIED-HMAC-SHA256: 071ef80d5
95107
<version>v2.3.0</version>
96108
</dependency>
97109
```
98-
99-

0 commit comments

Comments
 (0)