Skip to content

Commit bd62127

Browse files
committed
Release 2.2.7
1 parent f8ed3af commit bd62127

File tree

6 files changed

+39
-9
lines changed

6 files changed

+39
-9
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Add this dependency to your project's POM:
2323
<dependency>
2424
<groupId>com.postfinancecheckout</groupId>
2525
<artifactId>postfinancecheckout-java-sdk</artifactId>
26-
<version>2.2.6</version>
26+
<version>2.2.7</version>
2727
<scope>compile</scope>
2828
</dependency>
2929
```
@@ -33,7 +33,7 @@ Add this dependency to your project's POM:
3333
Add this dependency to your project's build file:
3434

3535
```groovy
36-
compile "com.postfinancecheckout:postfinancecheckout-java-sdk:2.2.6"
36+
compile "com.postfinancecheckout:postfinancecheckout-java-sdk:2.2.7"
3737
```
3838

3939
### Others
@@ -46,7 +46,7 @@ mvn clean package
4646

4747
Then manually install the following JARs:
4848

49-
* `target/postfinancecheckout-java-sdk-2.2.6.jar`
49+
* `target/postfinancecheckout-java-sdk-2.2.7.jar`
5050
* `target/lib/*.jar`
5151

5252
## Usage

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apply plugin: 'idea'
22
apply plugin: 'eclipse'
33

44
group = 'com.postfinancecheckout'
5-
version = '2.2.6'
5+
version = '2.2.7'
66

77
buildscript {
88
repositories {

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ lazy val root = (project in file(".")).
22
settings(
33
organization := "com.postfinancecheckout",
44
name := "postfinancecheckout-java-sdk",
5-
version := "2.2.6",
5+
version := "2.2.7",
66
scalaVersion := "2.11.4",
77
scalacOptions ++= Seq("-feature"),
88
javacOptions in compile ++= Seq("-Xlint:deprecation"),

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<artifactId>postfinancecheckout-java-sdk</artifactId>
66
<packaging>jar</packaging>
77
<name>postfinancecheckout-java-sdk</name>
8-
<version>2.2.6</version>
8+
<version>2.2.7</version>
99
<url>https://www.postfinance.ch/checkout</url>
1010
<description>The SDK for simplifying the integration with PostFinance Checkout API.</description>
1111
<scm>

src/main/java/com/postfinancecheckout/sdk/ApiClient.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.postfinancecheckout.sdk;
22

33
import com.postfinancecheckout.sdk.service.*;
4+
import com.fasterxml.jackson.annotation.JsonInclude;
45
import com.fasterxml.jackson.databind.DeserializationFeature;
56
import com.fasterxml.jackson.databind.ObjectMapper;
67
import com.fasterxml.jackson.databind.SerializationFeature;
@@ -29,6 +30,7 @@ private static ObjectMapper createDefaultObjectMapper() {
2930
.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
3031
.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
3132
.setDateFormat(new RFC3339DateFormat());
33+
objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
3234
objectMapper.registerModule(new JavaTimeModule());
3335
return objectMapper;
3436
}

src/test/java/com/postfinancecheckout/sdk/test/TransactionServiceTest.java

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,16 @@ private TransactionCreate getTransactionPayload() {
5252
.amountIncludingTax(BigDecimal.valueOf(29.95))
5353
.sku("red-t-shirt-123");
5454

55+
56+
// Customer email address
57+
String customerEmailAddress = "[email protected]";
58+
59+
5560
// Customer Billind Address
5661
AddressCreate billingAddress = new AddressCreate();
5762
billingAddress.city("Winterthur")
5863
.country("CH")
59-
.emailAddress("[email protected]")
64+
.emailAddress(customerEmailAddress)
6065
.familyName("Customer")
6166
.givenName("Good")
6267
.postcode("8400")
@@ -70,6 +75,8 @@ private TransactionCreate getTransactionPayload() {
7075
this.transactionPayload.setBillingAddress(billingAddress);
7176
this.transactionPayload.setShippingAddress(billingAddress);
7277
this.transactionPayload.addLineItemsItem(lineItem);
78+
this.transactionPayload.setCustomerId("1234");
79+
this.transactionPayload.setCustomerEmailAddress(customerEmailAddress);
7380
}
7481
return this.transactionPayload;
7582
}
@@ -375,10 +382,31 @@ public void updateTest() {
375382
/**
376383
* updateTransactionLineItems
377384
*/
378-
@Ignore
379385
@Test
380386
public void updateTransactionLineItemsTest() {
381-
// TODO: test validations
387+
try {
388+
Transaction transaction = this.apiClient.getTransactionService().create(this.spaceId, this.getTransactionPayload());
389+
390+
// Line item
391+
LineItemCreate lineItem = new LineItemCreate();
392+
lineItem.name("Blue T-Shirt")
393+
.uniqueId("5413")
394+
.type(LineItemType.PRODUCT)
395+
.quantity(BigDecimal.valueOf(1))
396+
.amountIncludingTax(BigDecimal.valueOf(39.95))
397+
.sku("blue-t-shirt-123");
398+
399+
TransactionPending transactionPending = new TransactionPending();
400+
transactionPending.version(transaction.getVersion().longValue())
401+
.id(transaction.getId())
402+
.addLineItemsItem(lineItem)
403+
.customerId(transaction.getCustomerId())
404+
.currency(transaction.getCurrency());
405+
Transaction transactionUpdate = this.apiClient.getTransactionService().update(spaceId, transactionPending);
406+
Assert.assertEquals(transaction.getId(), transactionUpdate.getId());
407+
}catch (Exception e){
408+
e.printStackTrace();
409+
}
382410
}
383411

384412
}

0 commit comments

Comments
 (0)