Skip to content

Commit edbeb38

Browse files
authored
Release 4.0.0 (#111)
1 parent 3f2e9e6 commit edbeb38

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1326
-678
lines changed

.github/hooks/prepare-commit-msg

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
# Automatically adds ticket number to every commit message.
3+
# Ticket number is extracted from branch name.
4+
#
5+
# See: https://gist.github.com/jimschubert/9073276
6+
7+
COMMIT_MESSAGE_FILE=$1
8+
COMMIT_MESSAGE=$(cat "$COMMIT_MESSAGE_FILE")
9+
10+
# Don't apply this logic if we are in a 'detached head' state (rebasing, read-only history, etc)
11+
# newlines below may need echo -e "\n\n: (etc.)"
12+
BRANCH_NAME=$(git symbolic-ref --short HEAD)
13+
if [[ "$BRANCH_NAME" =~ ^CC-[0-9]+/. ]]; then
14+
TICKET=$(echo "$BRANCH_NAME" | cut -d "/" -f 1)
15+
echo "[$TICKET] $COMMIT_MESSAGE" > "$COMMIT_MESSAGE_FILE"
16+
fi

.github/workflows/publish.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Publish package to the Maven Central Repository
2+
on:
3+
release:
4+
types: [ created ]
5+
jobs:
6+
publish:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
- name: Set up Maven Central Repository
11+
uses: actions/setup-java@v3
12+
with:
13+
java-version: '17'
14+
distribution: 'temurin'
15+
cache: maven
16+
server-id: ossrh
17+
server-username: MAVEN_USERNAME
18+
server-password: MAVEN_PASSWORD
19+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
20+
gpg-passphrase: GPG_PASSPHRASE
21+
- name: Publish package
22+
run: mvn --batch-mode -DskipTests=true deploy
23+
env:
24+
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
25+
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
26+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

CHANGELOG.md

+24
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,28 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
66
and this project adheres
77
to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
88

9+
## [4.0.0][4.0.0]
10+
11+
This release brings liability and exemption type support to Java SDK
12+
13+
### Added
14+
15+
* Added `Liability` and `ExemptionType` fields to `AdditionalTransactionData.CardTransactionData`
16+
17+
### Removed
18+
19+
* Removed resource `version.properties`. Version is set at generate-sources phase.
20+
* Removed class `com.unzer.payment.exceptions.PropertiesException`
21+
* Removed deprecated method `com.unzer.payment.util.SDKInfo::getVersion()`. Please, use `com.unzer.payment.util.SDKInfo.VERSION` instead
22+
23+
### Changed
24+
25+
* Enriched request and response logging
26+
27+
### Fixed
28+
29+
* Fixed `AdditionalTransactionData.RecurrenceType` field is empty for fetched transactions.
30+
931
## [3.1.1][3.1.1]
1032

1133
This release updates dependencies with security issues
@@ -325,6 +347,8 @@ This release brings Unzer Paylater Invoice payment type support to Java SDK.
325347
* Remove deprecated classes
326348
* RestCommunication
327349

350+
[4.0.0]: http://github.com/unzerdev/java-sdk/compare/3.1.1..4.0.0
351+
328352
[3.1.1]: http://github.com/unzerdev/java-sdk/compare/3.1.0..3.1.1
329353

330354
[3.1.0]: http://github.com/unzerdev/java-sdk/compare/3.0.0..3.1.0

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Java 1.8 or later.
1414
<dependency>
1515
<groupId>com.unzer.payment</groupId>
1616
<artifactId>java-sdk</artifactId>
17-
<version>3.1.1</version>
17+
<version>4.0.0</version>
1818
</dependency>
1919
```
2020

pom.xml

+45-29
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.unzer.payment</groupId>
88
<artifactId>java-sdk</artifactId>
9-
<version>3.1.1</version>
9+
<version>4.0.0</version>
1010
<name>Unzer Java SDK</name>
1111
<description>Unzer Java SDK provides an easy way to connect to the Unzer Rest API.</description>
1212
<url>https://docs.unzer.com/</url>
@@ -49,12 +49,14 @@
4949

5050
<distributionManagement>
5151
<snapshotRepository>
52-
<id>mpay24</id>
53-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
52+
<id>ossrh</id>
53+
<name>Snapshot Repository OSSRH</name>
54+
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
5455
</snapshotRepository>
5556
<repository>
56-
<id>mpay24</id>
57-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
57+
<id>ossrh</id>
58+
<name>Central Repository OSSRH</name>
59+
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
5860
</repository>
5961
</distributionManagement>
6062

@@ -63,20 +65,14 @@
6365
<plugin>
6466
<groupId>org.apache.maven.plugins</groupId>
6567
<artifactId>maven-javadoc-plugin</artifactId>
66-
<version>3.2.0</version>
68+
<version>4.0.0</version>
6769
</plugin>
6870
</plugins>
6971
</reporting>
7072

7173
<build>
7274
<sourceDirectory>src/main/java</sourceDirectory>
7375
<testSourceDirectory>src/test/java</testSourceDirectory>
74-
<resources>
75-
<resource>
76-
<directory>src/main/resources</directory>
77-
<filtering>true</filtering>
78-
</resource>
79-
</resources>
8076
<testResources>
8177
<testResource>
8278
<directory>src/test/resources</directory>
@@ -86,7 +82,7 @@
8682
<plugin>
8783
<groupId>org.owasp</groupId>
8884
<artifactId>dependency-check-maven</artifactId>
89-
<version>6.5.0</version>
85+
<version>8.0.1</version>
9086
<configuration>
9187
<skipProvidedScope>true</skipProvidedScope>
9288
<skipRuntimeScope>true</skipRuntimeScope>
@@ -143,7 +139,7 @@
143139
<plugin>
144140
<groupId>org.apache.maven.plugins</groupId>
145141
<artifactId>maven-javadoc-plugin</artifactId>
146-
<version>3.4.0</version>
142+
<version>3.4.1</version>
147143
<configuration>
148144
<doclint>none</doclint>
149145
</configuration>
@@ -173,7 +169,7 @@
173169
<plugin>
174170
<groupId>org.apache.maven.plugins</groupId>
175171
<artifactId>maven-gpg-plugin</artifactId>
176-
<version>1.6</version>
172+
<version>3.0.1</version>
177173
<executions>
178174
<execution>
179175
<id>sign-artifacts</id>
@@ -190,19 +186,6 @@
190186
</execution>
191187
</executions>
192188
</plugin>
193-
194-
<plugin>
195-
<groupId>org.sonatype.plugins</groupId>
196-
<artifactId>nexus-staging-maven-plugin</artifactId>
197-
<version>1.6.8</version>
198-
<extensions>true</extensions>
199-
<configuration>
200-
<serverId>mpay24</serverId>
201-
<nexusUrl>https://s01.oss.sonatype.org</nexusUrl>
202-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
203-
<stagingProgressTimeoutMinutes>20</stagingProgressTimeoutMinutes>
204-
</configuration>
205-
</plugin>
206189
<plugin>
207190
<groupId>org.apache.maven.plugins</groupId>
208191
<artifactId>maven-surefire-plugin</artifactId>
@@ -224,7 +207,19 @@
224207
</execution>
225208
</executions>
226209
</plugin>
227-
210+
<plugin>
211+
<groupId>org.codehaus.mojo</groupId>
212+
<artifactId>templating-maven-plugin</artifactId>
213+
<version>1.0.0</version>
214+
<executions>
215+
<execution>
216+
<id>filtering-java-templates</id>
217+
<goals>
218+
<goal>filter-sources</goal>
219+
</goals>
220+
</execution>
221+
</executions>
222+
</plugin>
228223
<plugin>
229224
<groupId>com.mycila</groupId>
230225
<artifactId>license-maven-plugin</artifactId>
@@ -298,6 +293,13 @@
298293
<scope>test</scope>
299294
</dependency>
300295

296+
<dependency>
297+
<groupId>com.github.tomakehurst</groupId>
298+
<artifactId>wiremock-jre8</artifactId>
299+
<version>2.35.0</version>
300+
<scope>test</scope>
301+
</dependency>
302+
301303
<dependency>
302304
<groupId>org.awaitility</groupId>
303305
<artifactId>awaitility</artifactId>
@@ -353,6 +355,20 @@
353355
<version>5.3.0</version>
354356
<scope>test</scope>
355357
</dependency>
358+
359+
<dependency>
360+
<groupId>org.apache.logging.log4j</groupId>
361+
<artifactId>log4j-core</artifactId>
362+
<version>2.19.0</version>
363+
<scope>test</scope>
364+
</dependency>
365+
366+
<dependency>
367+
<groupId>org.apache.logging.log4j</groupId>
368+
<artifactId>log4j-slf4j-impl</artifactId>
369+
<version>2.19.0</version>
370+
<scope>test</scope>
371+
</dependency>
356372
</dependencies>
357373

358374
<dependencyManagement>

src/main/java/com/unzer/payment/exceptions/PropertiesException.java renamed to src/main/java-templates/com/unzer/payment/util/SDKInfo.java

+3-7
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,8 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package com.unzer.payment.exceptions;
17-
18-
public class PropertiesException extends RuntimeException {
19-
20-
public PropertiesException(String msg) {
21-
super(msg);
22-
}
16+
package com.unzer.payment.util;
2317

18+
public class SDKInfo {
19+
public final static String VERSION = "${project.version}";
2420
}

0 commit comments

Comments
 (0)