From 042457756fad5f7ebfb55de7fd364ea7a6ba214d Mon Sep 17 00:00:00 2001 From: Blackfaded Date: Wed, 24 Jul 2024 16:28:03 +0200 Subject: [PATCH 1/4] chore: cleanup unused imports --- .../commerce/platform/lib/endpoints/CheckoutApiClientTest.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/src/test/java/com/payone/commerce/platform/lib/endpoints/CheckoutApiClientTest.java b/lib/src/test/java/com/payone/commerce/platform/lib/endpoints/CheckoutApiClientTest.java index 9e0905c..c37396b 100644 --- a/lib/src/test/java/com/payone/commerce/platform/lib/endpoints/CheckoutApiClientTest.java +++ b/lib/src/test/java/com/payone/commerce/platform/lib/endpoints/CheckoutApiClientTest.java @@ -10,8 +10,6 @@ import java.io.IOException; import java.security.InvalidKeyException; -import java.util.Arrays; -import java.util.List; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Nested; From 03781291328730be6b5db60a660de6693559774f Mon Sep 17 00:00:00 2001 From: Blackfaded Date: Wed, 24 Jul 2024 16:28:18 +0200 Subject: [PATCH 2/4] chore: add version update to readme.md --- prepare-release.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/prepare-release.sh b/prepare-release.sh index 0e26d25..6419ddd 100755 --- a/prepare-release.sh +++ b/prepare-release.sh @@ -23,14 +23,18 @@ TAG=v$VERSION BUILD_GRADLE_PATH="./lib/build.gradle" SERVER_META_INFO_PATH="./lib/src/main/java/com/payone/commerce/platform/lib/utils/ServerMetaInfo.java" +README_PATH="./README.md" # Update the version in the build.gradle file sed -i '' "s/version = '[0-9]*\.[0-9]*\.[0-9]*'/version = '$VERSION'/" $BUILD_GRADLE_PATH # Update the version in the ServerMetaInfo.java file sed -i '' "s/JavaServerSDK\/v[0-9]*\.[0-9]*\.[0-9]*/JavaServerSDK\/$TAG/" $SERVER_META_INFO_PATH +# update the version in the readme file +sed -i '' "s/version: '[0-9]*\.[0-9]*\.[0-9]*'/version: '$VERSION'/g" $README_PATH git add $BUILD_GRADLE_PATH git add $SERVER_META_INFO_PATH +git add $README_PATH git commit -m "Update version to $VERSION" git tag -a $TAG -m "Release version $VERSION" git push origin $TAG From fd0303f81a5f8115ccf9042f5db4d0b61f84bf2e Mon Sep 17 00:00:00 2001 From: Blackfaded Date: Wed, 24 Jul 2024 16:28:55 +0200 Subject: [PATCH 3/4] chore: sync version --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4ff2902..ee5ffdc 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Welcome to the Java SDK for the PayOne PCP platform! This repository contains a ```groovy dependencies { - implementation group: 'io.github.payone-gmbh', name: 'pcp-serversdk-java', version: '0.0.1' + implementation group: 'io.github.payone-gmbh', name: 'pcp-serversdk-java', version: '0.0.2' } ``` From 53c6c02ec6d3ef8be8baa5f4462b1aae48310eaa Mon Sep 17 00:00:00 2001 From: Blackfaded Date: Thu, 25 Jul 2024 08:50:15 +0200 Subject: [PATCH 4/4] refactor: do not use null variable --- .../platform/lib/endpoints/CheckoutApiClient.java | 8 ++------ .../platform/lib/endpoints/CommerceCaseApiClient.java | 4 +--- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/lib/src/main/java/com/payone/commerce/platform/lib/endpoints/CheckoutApiClient.java b/lib/src/main/java/com/payone/commerce/platform/lib/endpoints/CheckoutApiClient.java index 1eaf155..eaa6e5d 100644 --- a/lib/src/main/java/com/payone/commerce/platform/lib/endpoints/CheckoutApiClient.java +++ b/lib/src/main/java/com/payone/commerce/platform/lib/endpoints/CheckoutApiClient.java @@ -50,9 +50,7 @@ public CreateCheckoutResponse createCheckoutRequest(String merchantId, String co .addPathSegment("checkouts") .build(); - String jsonString = null; - - jsonString = getJsonMapper().writeValueAsString(payload); + String jsonString = getJsonMapper().writeValueAsString(payload); Request request = new Request.Builder() .url(url) @@ -156,9 +154,7 @@ public void updateCheckoutRequest(String merchantId, String commerceCaseId, Stri .addPathSegment(checkoutId) .build(); - String jsonString = null; - - jsonString = getJsonMapper().writeValueAsString(payload); + String jsonString = getJsonMapper().writeValueAsString(payload); Request request = new Request.Builder() .url(url) diff --git a/lib/src/main/java/com/payone/commerce/platform/lib/endpoints/CommerceCaseApiClient.java b/lib/src/main/java/com/payone/commerce/platform/lib/endpoints/CommerceCaseApiClient.java index e8aaa98..80cecc3 100644 --- a/lib/src/main/java/com/payone/commerce/platform/lib/endpoints/CommerceCaseApiClient.java +++ b/lib/src/main/java/com/payone/commerce/platform/lib/endpoints/CommerceCaseApiClient.java @@ -144,9 +144,7 @@ public void updateCommerceCaseRequest(String merchantId, String commerceCaseId, .addPathSegment(commerceCaseId) .build(); - String jsonString = null; - - jsonString = getJsonMapper().writeValueAsString(payload); + String jsonString = getJsonMapper().writeValueAsString(payload); RequestBody formBody = RequestBody.create("{\"customer\":" + jsonString + "}", JSON);