Skip to content

Commit dda6f66

Browse files
authored
Merge pull request #80 from unzerdev/develop
Release v1.2.0.0
2 parents 4df6278 + 3f28d74 commit dda6f66

Some content is hidden

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

44 files changed

+2482
-1457
lines changed

.github/workflows/maven.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
3+
4+
name: Java CI with Maven
5+
6+
on:
7+
pull_request:
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v3
16+
- name: Set up JDK 11
17+
uses: actions/setup-java@v3
18+
with:
19+
java-version: '11'
20+
distribution: 'temurin'
21+
cache: maven
22+
- name: Set timezone
23+
run: sudo timedatectl set-timezone Europe/Berlin
24+
- name: Run unit tests
25+
env:
26+
PAPI_PUBLIC_KEY: ${{ secrets.PAPI_PUBLIC_KEY }}
27+
PAPI_PRIVATE_KEY: ${{ secrets.PAPI_PRIVATE_KEY }}
28+
run: mvn -B test --file pom.xml -Dpublickey1="$PAPI_PUBLIC_KEY" -Dprivatekey1="$PAPI_PRIVATE_KEY" -Dprivatekey2="$PAPI_PRIVATE_KEY" -Dprivatekey3="$PAPI_PRIVATE_KEY" -DmarketplacePrivatekey="$PAPI_PRIVATE_KEY"

.gitignore

+1-35
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,10 @@
11
target/
22
!.mvn/wrapper/maven-wrapper.jar
33

4-
### maven ###
4+
### Maven ###
55
.mvn/
66
mvnm.*
77

8-
### Gradle ###
9-
.gradle/
10-
11-
### STS ###
12-
.apt_generated
13-
.classpath
14-
.factorypath
15-
.project
16-
.settings
17-
.springBeans
18-
198
### IntelliJ IDEA ###
209
.idea
21-
*.iws
2210
*.iml
23-
*.ipr
24-
25-
### NetBeans ###
26-
nbproject/private/
27-
build/
28-
nbbuild/
29-
dist/
30-
nbdist/
31-
.nb-gradle/
32-
mvnw
33-
mvnw.cmd
34-
db/papi_db.script
35-
db/papi_db.properties
36-
db/papi_db.lck
37-
db/papi_db.log
38-
db/papi_database.mv.db
39-
/db/
40-
/logging.log
41-
/logs/
42-
/log/
43-
/sns_auto_gen_folder/
44-
docs/node_modules/

.idea/.gitignore

-2
This file was deleted.

.settings/.gitignore

-2
This file was deleted.

CHANGELOG.md

+78-11
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,93 @@
22

33
All notable changes to this project will be documented in this file.
44

5-
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres
5+
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
6+
and this project adheres
67
to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
78

9+
## [1.2.0.0][1.2.0.0]
10+
11+
### Breaking changes
12+
13+
* Removed `log4j-core` from Maven dependencies. **Please, provide logger
14+
implementation on your own**
15+
16+
* Renamed enum value `AbstractTransaction.Status.ERRROR` to `AbstractTransaction.Status.ERROR`
17+
18+
* Renamed enum value `Paypage.Status.ERRROR` to `Paypage.Status.ERROR`
19+
20+
### Deprecated
21+
22+
* `com.unzer.payment.service.UrlUtil#getUrl(String)` will not be part of
23+
java-sdk, because it has nothing to do with unzer/sdk specific logic. If you
24+
rely on this method, please, replace it with `java.net.URL#URL(String)`
25+
constructor call
26+
27+
* Deprecated Basket getters/setters: `amountTotalVat`, `amountTotalGross`,
28+
`amountTotalDiscount`
29+
30+
* Deprecated BasketItem getters/setters: `amountDiscount`, `amountGross`, `amountVat`,
31+
`amountPerUnit`, `amountNet`
32+
33+
### Added
34+
35+
* Basket v2 support:
36+
37+
* Basket getters/setters: `totalValueGross`
38+
39+
* BasketItem getters/setters: `amountPerUnitGross`, `amountDiscountPerUnitGross`
40+
41+
### Removed
42+
43+
* Remove `log.error` in catch clause
44+
`com.unzer.payment.service.PropertiesUtil#loadProperties()` because the
45+
exception with exact same message is thrown after the `log.error` call.
46+
47+
### Fixed
48+
49+
* Fix log message of `com.unzer.payment.service.UrlUtil#getUrl(String)`. It was
50+
not formatted and contained `%s` instead
51+
of values
52+
53+
### Changed
54+
55+
* Type of `BasketItem` type field (was `String`, become `BasketItem.Type`)
56+
57+
* Type of `BasketItem` `vat` field (was `Integer`, become `BigDecimal`)
58+
859
## [1.1.2.7][1.1.2.7]
960

1061
### Changed
11-
* Upgrade of the used gson Dependencies from 2.8.6 to 2.8.9
12-
* Upgrade of the used faster-xml dependencies from 2.11.3 to 2.12.7
13-
* Upgrade of the used log4j dependencies from 2.17.1 to 2.18.0
62+
63+
* Upgrade of the used gson Dependencies from 2.8.6 to 2.8.9
64+
* Upgrade of the used faster-xml dependencies from 2.11.3 to 2.12.7
65+
* Upgrade of the used log4j dependencies from 2.17.1 to 2.18.0
1466

1567
## [1.1.2.6][1.1.2.6]
1668

1769
### Added
70+
1871
* Added Unzer-Logo and updated the reference in Readme-File.
19-
* Added Json-Validation to JsonParser-Class before real Json-Deserialization happens.
72+
* Added Json-Validation to JsonParser-Class before real Json-Deserialization
73+
happens.
74+
2075
* Added Twitter-Handle to Readme-File.
2176

2277
### Changed
78+
2379
* Documentation-Link in Readme-File has been changed.
2480
* Several minor improvements.
2581

2682
## [1.1.2.5][1.1.2.5]
2783

2884
### Changed
2985

30-
* Upgrade of the used Log4j Dependencies to fix the Log4j Zero-Day-Exploit from 2.16.0 to 2.17.0.
31-
* Handling of PaymentException-Message has been changed to now return correct Message on occurrence.
86+
* Upgrade of the used Log4j Dependencies to fix the Log4j Zero-Day-Exploit from
87+
2.16.0 to 2.17.0.
88+
89+
* Handling of PaymentException-Message has been changed to now return correct
90+
Message on occurrence.
91+
3292
* Several minor improvements.
3393

3494
## [1.1.2.4][1.1.2.4]
@@ -62,7 +122,9 @@ to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
62122

63123
### Changed
64124

65-
* Changed the DateTime-Handling from PAPI so that all timezones will be handled correctly in parsing and formatting.
125+
* Changed the DateTime-Handling from PAPI so that all timezones will be handled
126+
correctly in parsing and formatting.
127+
66128
* Several minor improvements.
67129

68130
## [1.1.2.0][1.1.2.0]
@@ -97,11 +159,14 @@ to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
97159

98160
### Fixed
99161

100-
* Fixed the Way how the PAPI-Keypairs are loaded on Unzer Object Creation and eliminated the NullPointerException which was thrown.
162+
* Fixed the Way how the PAPI-Keypairs are loaded on Unzer Object Creation and
163+
eliminated the NullPointerException which
164+
was thrown.
101165

102166
### Changed
103167

104-
* Some Tests were failing because of missing Merchant Configuration of the used Test-Merchant.
168+
* Some Tests were failing because of missing Merchant Configuration of the used
169+
Test-Merchant.
105170

106171
## [1.1.0.0][1.1.0.0]
107172

@@ -140,6 +205,8 @@ to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
140205
* Remove deprecated classes
141206
* RestCommunication
142207

208+
[1.2.0.0]: http://github.com/unzerdev/java-sdk/compare/1.1.2.7..1.2.0.0
209+
143210
[1.1.2.7]: http://github.com/unzerdev/java-sdk/compare/1.1.2.6..1.1.2.7
144211

145212
[1.1.2.6]: http://github.com/unzerdev/java-sdk/compare/1.1.2.5..1.1.2.6
@@ -162,4 +229,4 @@ to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
162229

163230
[1.1.0.1]: http://github.com/unzerdev/java-sdk/compare/1.1.0.0..1.1.0.1
164231

165-
[1.1.0.0]: http://github.com/unzerdev/java-sdk/compare/c45ad44972e4a96b30b0744f5b70734f2122f142..1.1.0.0
232+
[1.1.0.0]: http://github.com/unzerdev/java-sdk/compare/c45ad44972e4a96b30b0744f5b70734f2122f142..1.1.0.0

README.md

+27-10
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,41 @@
1-
![Logo](unzer_logo.svg)
1+
![Logo](docs/images/unzer_logo.svg)
22

33
# Unzer Java Payment SDK
4+
45
This SDK provides for an easy way to connect to the Unzer Rest API.
56

67
## Requirements
78

89
Java 1.8 or later.
910

1011
## Installation
12+
1113
```xml
1214
<dependency>
1315
<groupId>com.unzer.payment</groupId>
1416
<artifactId>java-sdk</artifactId>
15-
<version>1.1.2.7</version>
17+
<version>1.2.0.0</version>
1618
</dependency>
1719
```
1820

1921
## Documentation
22+
2023
Documentation is available at https://docs.unzer.com/server-side-integration/java-sdk-integration/.
2124

2225
## SDK Overview
26+
2327
### Unzer class
28+
2429
The Unzer class is instantiated using your private or public key:
30+
2531
```java
2632
Unzer unzer = new Unzer("s-priv-xxxxxxxxxx");
2733
```
34+
2835
You can inject a custom implementation of the http-network communication into the Unzer constructor. For implementing a custom communication stack, you have to subclass the AbstractUnzerRestCommunication class together with a UnzerHttpRequest. For an example please refer to the reference implementation HttpClientBasedRestCommunication.
2936

3037
### Authorize or Charge a payment
38+
3139
The first step is to create a Payment Type and then do an authorize or charge for this Payment Type
3240

3341
Example for Authorize
@@ -57,9 +65,10 @@ Charge charge = unzer.charge(BigDecimal.ONE, Currency.getInstance("EUR"), "s-sft
5765
Charge charge2 = unzer.charge(BigDecimal.ONE, Currency.getInstance("EUR"), new Sofort(), new URL("https://www.unzer.com"));
5866
```
5967

60-
As a result for authorize or charge an Authorization or Charge object will be returned which contains a reference to a Payment object.
68+
As a result for authorize or charge an Authorization or Charge object will be returned which contains a reference to a Payment object.
6169

6270
### Payment status
71+
6372
To query the status of a payment you can fetch the Payment:
6473

6574
```java
@@ -69,7 +78,8 @@ Payment payment = unzer.fetchPayment(authorize.getPayment().getId());
6978
```
7079

7180
### Charge after Authorize
72-
If you started the payment with an authorize (reservation) then you can do a Charge based on this Authorization.
81+
82+
If you started the payment with an authorize (reservation) then you can do a Charge based on this Authorization.
7383
There are different options to Charge after an Authorization:
7484

7585
```java
@@ -88,6 +98,7 @@ Charge charge3 = unzer.chargeAuthorization("s-pay-1");
8898
```
8999

90100
### Cancel an Authorize
101+
91102
Cancelling a payment after authorization. There are again three options how to do this:
92103

93104
```java
@@ -105,7 +116,8 @@ Cancel cancel2 = payment.cancel(new BigDecimal(0.1));
105116
Cancel cancel3 = unzer.cancelAuthorization("s-pay-1");
106117
```
107118

108-
### Cancel on Charge (Refund)
119+
### Cancel on Charge (Refund)
120+
109121
Cancelling a charge refunds money from the merchant to the customer. There are several options how to do a refund:
110122

111123
```java
@@ -119,8 +131,8 @@ Cancel cancel = charge.cancel();
119131
Cancel cancel = unzer.cancelCharge("s-pay-1", "s-chg-1", BigDecimal.ONE);
120132
```
121133

134+
### Shipment
122135

123-
### Shipment
124136
To execute a Shipment you need to call the shipment method in Unzer object:
125137

126138
```java
@@ -130,17 +142,22 @@ Shipment shipment = unzer.shipment(authorize.getPaymentId());
130142
```
131143

132144
## Support
145+
133146
For any issues or questions please get in touch with our support team.
134147

135148
### Web page
136-
[https://docs.unzer.com/](https://docs.unzer.com/)
149+
150+
<https://docs.unzer.com/>
137151

138152
### Email
153+
139154
140155

141156
### Phone
142-
* DE: [+49 6221 43101-00](tel:+4962214310100)
143-
* AT: [+43 1 513 66 33 669](tel:+4315136633669)
157+
158+
* DE: [+49 6221 43101-00](tel:+4962214310100)
159+
* AT: [+43 1 513 66 33 669](tel:+4315136633669)
144160

145161
### Twitter
146-
[@UnzerTech](https://twitter.com/UnzerTech)
162+
163+
[@UnzerTech](https://twitter.com/UnzerTech)
File renamed without changes.

0 commit comments

Comments
 (0)