Skip to content

Commit a57c928

Browse files
authored
Release 1.2.2.0 (#90)
2 parents 8f60135 + efa8035 commit a57c928

26 files changed

+749
-762
lines changed

.github/workflows/maven.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v3
14+
- name: Install Chrome driver # for integration tests with Selenium
15+
uses: nanasess/setup-chromedriver@v1
1416
- name: Set up JDK 11
1517
uses: actions/setup-java@v3
1618
with:

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,21 @@ 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+
## [1.2.2.0][1.2.2.0]
10+
11+
This release adds Klarna payment type to Java SDK.
12+
13+
### Added
14+
15+
* Added payment type `Klarna`.
16+
* Added `language` field to `Customer` resource.
17+
* Added `termsAndConditionsUrl` and `privacyPolicyUrl` fields to `AdditionalTransactionData` resource
18+
19+
### Fixed
20+
21+
* Fixed typo `ShippingAddress.Type:DIFFERENT_ADDRESSES` -> `ShippingAddress.Type:DIFFERENT_ADDRESS`. This typo caused errors on authorize/charge in some payment cases
22+
* Fixed (de-)serialization of `AbstractTransaction` cause infinite Webhook calls.
23+
924
## [1.2.1.0][1.2.1.0]
1025

1126
This release brings Unzer Paylater Invoice payment type support to Java SDK.
@@ -234,6 +249,8 @@ This release brings Unzer Paylater Invoice payment type support to Java SDK.
234249
* Remove deprecated classes
235250
* RestCommunication
236251

252+
[1.2.2.0]: http://github.com/unzerdev/java-sdk/compare/1.2.1.0..1.2.2.0
253+
237254
[1.2.1.0]: http://github.com/unzerdev/java-sdk/compare/1.2.0.0..1.2.1.0
238255

239256
[1.2.0.0]: http://github.com/unzerdev/java-sdk/compare/1.1.2.7..1.2.0.0

README.md

Lines changed: 1 addition & 1 deletion
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>1.2.1.0</version>
17+
<version>1.2.2.0</version>
1818
</dependency>
1919
```
2020

pom.xml

Lines changed: 7 additions & 15 deletions
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>1.2.1.0</version>
9+
<version>1.2.2.0</version>
1010
<name>Unzer Java SDK</name>
1111
<description>Unzer Java SDK</description>
1212
<url>https://docs.unzer.com/</url>
@@ -135,8 +135,8 @@
135135
<artifactId>maven-compiler-plugin</artifactId>
136136
<version>3.10.1</version>
137137
<configuration>
138-
<source>1.8</source>
139-
<target>1.8</target>
138+
<source>8</source>
139+
<target>8</target>
140140
</configuration>
141141
</plugin>
142142
<plugin>
@@ -319,7 +319,7 @@
319319
<dependency>
320320
<groupId>org.jsoup</groupId>
321321
<artifactId>jsoup</artifactId>
322-
<version>1.14.2</version>
322+
<version>1.15.3</version>
323323
<scope>test</scope>
324324
</dependency>
325325

@@ -330,7 +330,6 @@
330330
<scope>test</scope>
331331
</dependency>
332332

333-
<!-- UI Test dependencies Selenium -->
334333
<dependency>
335334
<groupId>org.seleniumhq.selenium</groupId>
336335
<artifactId>selenium-java</artifactId>
@@ -339,16 +338,9 @@
339338
</dependency>
340339

341340
<dependency>
342-
<groupId>org.seleniumhq.selenium</groupId>
343-
<artifactId>selenium-server</artifactId>
344-
<version>3.141.59</version>
345-
<scope>test</scope>
346-
</dependency>
347-
348-
<dependency>
349-
<groupId>org.seleniumhq.selenium</groupId>
350-
<artifactId>htmlunit-driver</artifactId>
351-
<version>2.39.0</version>
341+
<groupId>io.github.bonigarcia</groupId>
342+
<artifactId>webdrivermanager</artifactId>
343+
<version>3.8.1</version>
352344
<scope>test</scope>
353345
</dependency>
354346
</dependencies>

selenium/chrome/chromedriver

-14.1 MB
Binary file not shown.

selenium/chrome/chromedriver.exe

-8.19 MB
Binary file not shown.

selenium/geckodriver/geckodriver

-5.81 MB
Binary file not shown.

selenium/geckodriver/geckodriver.exe

-10.3 MB
Binary file not shown.

src/main/java/com/unzer/payment/AbstractTransaction.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import java.util.Date;
2626

2727
public abstract class AbstractTransaction<T extends AbstractPayment> implements PaymentType {
28-
2928
private String id;
3029
private BigDecimal amount;
3130
private Currency currency;
@@ -48,9 +47,9 @@ public abstract class AbstractTransaction<T extends AbstractPayment> implements
4847
private String type;
4948
private AdditionalTransactionData additionalTransactionData;
5049
@JsonFieldIgnore
51-
private T payment;
50+
private transient T payment;
5251
@JsonFieldIgnore
53-
private Unzer unzer;
52+
private transient Unzer unzer;
5453
@JsonFieldIgnore
5554
private URL resourceUrl;
5655

src/main/java/com/unzer/payment/Customer.java

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@
2020
import com.unzer.payment.paymenttypes.PaymentType;
2121

2222
import java.util.Date;
23+
import java.util.Locale;
2324

2425
/**
2526
* Business object for Customer together with billingAddress.
26-
*
27+
* <p>
2728
* firstname and lastname are mandatory to create a new Customer.
2829
*
2930
* @author Unzer E-Com GmbH
@@ -41,6 +42,15 @@ public class Customer implements PaymentType {
4142
private Address billingAddress;
4243
private ShippingAddress shippingAddress;
4344
private String company;
45+
46+
/**
47+
* Customer language.
48+
* <p>
49+
* Mandatory depending on payment type
50+
* Format: ISO 639 alpha-2 code
51+
*/
52+
private Locale language;
53+
4454
private CustomerCompanyData companyData;
4555

4656
public Customer(String firstname, String lastname) {
@@ -150,14 +160,14 @@ public ShippingAddress getShippingAddress() {
150160
}
151161

152162
public Customer setShippingAddress(ShippingAddress shippingAddress) {
153-
this.shippingAddress = shippingAddress;
154-
return this;
155-
}
163+
this.shippingAddress = shippingAddress;
164+
return this;
165+
}
156166

157167
/**
158168
* @deprecated use {@link #setShippingAddress(ShippingAddress)} instead
159169
*/
160-
@Deprecated
170+
@Deprecated
161171
public Customer setShippingAddress(Address shippingAddress) {
162172
this.shippingAddress = ShippingAddress.of(shippingAddress, null);
163173
return this;
@@ -175,8 +185,9 @@ public String getCompany() {
175185
return company;
176186
}
177187

178-
public void setCompany(String company) {
188+
public Customer setCompany(String company) {
179189
this.company = company;
190+
return this;
180191
}
181192

182193
@Override
@@ -188,6 +199,15 @@ public void setId(String id) {
188199
this.id = id;
189200
}
190201

202+
public Locale getLanguage() {
203+
return language;
204+
}
205+
206+
public Customer setLanguage(Locale language) {
207+
this.language = language;
208+
return this;
209+
}
210+
191211
public enum Salutation {
192212
@SerializedName("mr")
193213
MR,

0 commit comments

Comments
 (0)