Skip to content

Commit

Permalink
Release 2.2.8
Browse files Browse the repository at this point in the history
  • Loading branch information
vttn committed Oct 13, 2020
1 parent bd62127 commit c719e3a
Show file tree
Hide file tree
Showing 282 changed files with 3,773 additions and 2,081 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2020 customweb GmbH
Copyright 2020 wallee AG

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
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.7</version>
<version>2.2.8</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.7"
compile "com.postfinancecheckout:postfinancecheckout-java-sdk:2.2.8"
```

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

Then manually install the following JARs:

* `target/postfinancecheckout-java-sdk-2.2.7.jar`
* `target/postfinancecheckout-java-sdk-2.2.8.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.7'
version = '2.2.8'

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.7",
version := "2.2.8",
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.7</version>
<version>2.2.8</version>
<url>https://www.postfinance.ch/checkout</url>
<description>The SDK for simplifying the integration with PostFinance Checkout API.</description>
<scm>
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/com/postfinancecheckout/sdk/ApiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@ public class ApiClient {
private final ObjectMapper objectMapper;
private final long userId;
private final String applicationKey;
public final static int READ_TIMEOUT = 20 * 1000;

// A reasonable default object mapper. Client can pass in a chosen ObjectMapper anyway, this is just for reasonable defaults.
private static ObjectMapper createDefaultObjectMapper() {
ObjectMapper objectMapper = new ObjectMapper()
.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
.setDateFormat(new RFC3339DateFormat());
objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
.setDateFormat(new RFC3339DateFormat())
.setSerializationInclusion(JsonInclude.Include.NON_NULL);
objectMapper.registerModule(new JavaTimeModule());
return objectMapper;
}
Expand Down
17 changes: 10 additions & 7 deletions src/main/java/com/postfinancecheckout/sdk/RFC3339DateFormat.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* SDK
* PostFinance Checkout SDK
*
* This library allows to interact with the payment service.
* This library allows to interact with the PostFinance Checkout payment service.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,19 +18,22 @@

package com.postfinancecheckout.sdk;

import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
import com.fasterxml.jackson.databind.util.ISO8601Utils;
import com.fasterxml.jackson.databind.util.StdDateFormat;

import java.text.DateFormat;
import java.text.FieldPosition;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;


public class RFC3339DateFormat extends ISO8601DateFormat {
public class RFC3339DateFormat extends StdDateFormat {

// Same as ISO8601DateFormat but serializing milliseconds.
@Override
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
String value = ISO8601Utils.format(date, true);
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
String value = dateFormat.format(date);
toAppendTo.append(value);
return toAppendTo;
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/postfinancecheckout/sdk/StringUtil.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* SDK
* PostFinance Checkout SDK
*
* This library allows to interact with the payment service.
* This library allows to interact with the PostFinance Checkout payment service.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* SDK
* PostFinance Checkout SDK
*
* This library allows to interact with the payment service.
* This library allows to interact with the PostFinance Checkout payment service.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* SDK
* PostFinance Checkout SDK
*
* This library allows to interact with the payment service.
* This library allows to interact with the PostFinance Checkout payment service.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* SDK
* PostFinance Checkout SDK
*
* This library allows to interact with the payment service.
* This library allows to interact with the PostFinance Checkout payment service.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* SDK
* PostFinance Checkout SDK
*
* This library allows to interact with the payment service.
* This library allows to interact with the PostFinance Checkout payment service.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* SDK
* PostFinance Checkout SDK
*
* This library allows to interact with the payment service.
* This library allows to interact with the PostFinance Checkout payment service.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* SDK
* PostFinance Checkout SDK
*
* This library allows to interact with the payment service.
* This library allows to interact with the PostFinance Checkout payment service.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* SDK
* PostFinance Checkout SDK
*
* This library allows to interact with the payment service.
* This library allows to interact with the PostFinance Checkout payment service.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* SDK
* PostFinance Checkout SDK
*
* This library allows to interact with the payment service.
* This library allows to interact with the PostFinance Checkout payment service.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* SDK
* PostFinance Checkout SDK
*
* This library allows to interact with the payment service.
* This library allows to interact with the PostFinance Checkout payment service.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* SDK
* PostFinance Checkout SDK
*
* This library allows to interact with the payment service.
* This library allows to interact with the PostFinance Checkout payment service.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* SDK
* PostFinance Checkout SDK
*
* This library allows to interact with the payment service.
* This library allows to interact with the PostFinance Checkout payment service.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* SDK
* PostFinance Checkout SDK
*
* This library allows to interact with the payment service.
* This library allows to interact with the PostFinance Checkout payment service.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* SDK
* PostFinance Checkout SDK
*
* This library allows to interact with the payment service.
* This library allows to interact with the PostFinance Checkout payment service.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -28,6 +28,7 @@
import com.postfinancecheckout.sdk.model.LineItemCreate;
import com.postfinancecheckout.sdk.model.PaymentMethodBrand;
import com.postfinancecheckout.sdk.model.TokenizationMode;
import com.postfinancecheckout.sdk.model.TransactionCompletionBehavior;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
Expand Down Expand Up @@ -55,6 +56,10 @@ public class AbstractTransactionPending {
protected AddressCreate billingAddress = null;


@JsonProperty("completionBehavior")
protected TransactionCompletionBehavior completionBehavior = null;


@JsonProperty("currency")
protected String currency = null;

Expand Down Expand Up @@ -189,6 +194,25 @@ public void setBillingAddress(AddressCreate billingAddress) {
}


public AbstractTransactionPending completionBehavior(TransactionCompletionBehavior completionBehavior) {
this.completionBehavior = completionBehavior;
return this;
}

/**
* The completion behavior controls when the transaction is completed.
* @return completionBehavior
**/
@ApiModelProperty(value = "The completion behavior controls when the transaction is completed.")
public TransactionCompletionBehavior getCompletionBehavior() {
return completionBehavior;
}

public void setCompletionBehavior(TransactionCompletionBehavior completionBehavior) {
this.completionBehavior = completionBehavior;
}


public AbstractTransactionPending currency(String currency) {
this.currency = currency;
return this;
Expand Down Expand Up @@ -503,6 +527,7 @@ public boolean equals(java.lang.Object o) {
return Objects.equals(this.allowedPaymentMethodBrands, abstractTransactionPending.allowedPaymentMethodBrands) &&
Objects.equals(this.allowedPaymentMethodConfigurations, abstractTransactionPending.allowedPaymentMethodConfigurations) &&
Objects.equals(this.billingAddress, abstractTransactionPending.billingAddress) &&
Objects.equals(this.completionBehavior, abstractTransactionPending.completionBehavior) &&
Objects.equals(this.currency, abstractTransactionPending.currency) &&
Objects.equals(this.customerEmailAddress, abstractTransactionPending.customerEmailAddress) &&
Objects.equals(this.customerId, abstractTransactionPending.customerId) &&
Expand All @@ -522,7 +547,7 @@ public boolean equals(java.lang.Object o) {

@Override
public int hashCode() {
return Objects.hash(allowedPaymentMethodBrands, allowedPaymentMethodConfigurations, billingAddress, currency, customerEmailAddress, customerId, failedUrl, invoiceMerchantReference, language, lineItems, merchantReference, metaData, shippingAddress, shippingMethod, successUrl, timeZone, token, tokenizationMode);
return Objects.hash(allowedPaymentMethodBrands, allowedPaymentMethodConfigurations, billingAddress, completionBehavior, currency, customerEmailAddress, customerId, failedUrl, invoiceMerchantReference, language, lineItems, merchantReference, metaData, shippingAddress, shippingMethod, successUrl, timeZone, token, tokenizationMode);
}


Expand All @@ -534,6 +559,7 @@ public String toString() {
sb.append(" allowedPaymentMethodBrands: ").append(toIndentedString(allowedPaymentMethodBrands)).append("\n");
sb.append(" allowedPaymentMethodConfigurations: ").append(toIndentedString(allowedPaymentMethodConfigurations)).append("\n");
sb.append(" billingAddress: ").append(toIndentedString(billingAddress)).append("\n");
sb.append(" completionBehavior: ").append(toIndentedString(completionBehavior)).append("\n");
sb.append(" currency: ").append(toIndentedString(currency)).append("\n");
sb.append(" customerEmailAddress: ").append(toIndentedString(customerEmailAddress)).append("\n");
sb.append(" customerId: ").append(toIndentedString(customerId)).append("\n");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* SDK
* PostFinance Checkout SDK
*
* This library allows to interact with the payment service.
* This library allows to interact with the PostFinance Checkout payment service.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* SDK
* PostFinance Checkout SDK
*
* This library allows to interact with the payment service.
* This library allows to interact with the PostFinance Checkout payment service.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Loading

0 comments on commit c719e3a

Please sign in to comment.