Skip to content

Commit

Permalink
Release 2.2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
vttn committed Aug 21, 2020
1 parent f8ed3af commit bd62127
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 9 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Add this dependency to your project's POM:
<dependency>
<groupId>com.postfinancecheckout</groupId>
<artifactId>postfinancecheckout-java-sdk</artifactId>
<version>2.2.6</version>
<version>2.2.7</version>
<scope>compile</scope>
</dependency>
```
Expand All @@ -33,7 +33,7 @@ Add this dependency to your project's POM:
Add this dependency to your project's build file:

```groovy
compile "com.postfinancecheckout:postfinancecheckout-java-sdk:2.2.6"
compile "com.postfinancecheckout:postfinancecheckout-java-sdk:2.2.7"
```

### Others
Expand All @@ -46,7 +46,7 @@ mvn clean package

Then manually install the following JARs:

* `target/postfinancecheckout-java-sdk-2.2.6.jar`
* `target/postfinancecheckout-java-sdk-2.2.7.jar`
* `target/lib/*.jar`

## Usage
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'idea'
apply plugin: 'eclipse'

group = 'com.postfinancecheckout'
version = '2.2.6'
version = '2.2.7'

buildscript {
repositories {
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ lazy val root = (project in file(".")).
settings(
organization := "com.postfinancecheckout",
name := "postfinancecheckout-java-sdk",
version := "2.2.6",
version := "2.2.7",
scalaVersion := "2.11.4",
scalacOptions ++= Seq("-feature"),
javacOptions in compile ++= Seq("-Xlint:deprecation"),
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<artifactId>postfinancecheckout-java-sdk</artifactId>
<packaging>jar</packaging>
<name>postfinancecheckout-java-sdk</name>
<version>2.2.6</version>
<version>2.2.7</version>
<url>https://www.postfinance.ch/checkout</url>
<description>The SDK for simplifying the integration with PostFinance Checkout API.</description>
<scm>
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/postfinancecheckout/sdk/ApiClient.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.postfinancecheckout.sdk;

import com.postfinancecheckout.sdk.service.*;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
Expand Down Expand Up @@ -29,6 +30,7 @@ private static ObjectMapper createDefaultObjectMapper() {
.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
.setDateFormat(new RFC3339DateFormat());
objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
objectMapper.registerModule(new JavaTimeModule());
return objectMapper;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,16 @@ private TransactionCreate getTransactionPayload() {
.amountIncludingTax(BigDecimal.valueOf(29.95))
.sku("red-t-shirt-123");


// Customer email address
String customerEmailAddress = "[email protected]";


// Customer Billind Address
AddressCreate billingAddress = new AddressCreate();
billingAddress.city("Winterthur")
.country("CH")
.emailAddress("[email protected]")
.emailAddress(customerEmailAddress)
.familyName("Customer")
.givenName("Good")
.postcode("8400")
Expand All @@ -70,6 +75,8 @@ private TransactionCreate getTransactionPayload() {
this.transactionPayload.setBillingAddress(billingAddress);
this.transactionPayload.setShippingAddress(billingAddress);
this.transactionPayload.addLineItemsItem(lineItem);
this.transactionPayload.setCustomerId("1234");
this.transactionPayload.setCustomerEmailAddress(customerEmailAddress);
}
return this.transactionPayload;
}
Expand Down Expand Up @@ -375,10 +382,31 @@ public void updateTest() {
/**
* updateTransactionLineItems
*/
@Ignore
@Test
public void updateTransactionLineItemsTest() {
// TODO: test validations
try {
Transaction transaction = this.apiClient.getTransactionService().create(this.spaceId, this.getTransactionPayload());

// Line item
LineItemCreate lineItem = new LineItemCreate();
lineItem.name("Blue T-Shirt")
.uniqueId("5413")
.type(LineItemType.PRODUCT)
.quantity(BigDecimal.valueOf(1))
.amountIncludingTax(BigDecimal.valueOf(39.95))
.sku("blue-t-shirt-123");

TransactionPending transactionPending = new TransactionPending();
transactionPending.version(transaction.getVersion().longValue())
.id(transaction.getId())
.addLineItemsItem(lineItem)
.customerId(transaction.getCustomerId())
.currency(transaction.getCurrency());
Transaction transactionUpdate = this.apiClient.getTransactionService().update(spaceId, transactionPending);
Assert.assertEquals(transaction.getId(), transactionUpdate.getId());
}catch (Exception e){
e.printStackTrace();
}
}

}

0 comments on commit bd62127

Please sign in to comment.