Skip to content

Commit 30752dc

Browse files
Release 4.0.7
1 parent ebbc6a5 commit 30752dc

File tree

8 files changed

+166
-28
lines changed

8 files changed

+166
-28
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>ch.postfinance</groupId>
2525
<artifactId>postfinancecheckout-java-sdk</artifactId>
26-
<version>4.0.6</version>
26+
<version>4.0.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 "ch.postfinance:postfinancecheckout-java-sdk:4.0.6"
36+
compile "ch.postfinance:postfinancecheckout-java-sdk:4.0.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-4.0.6.jar`
49+
* `target/postfinancecheckout-java-sdk-4.0.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 = 'ch.postfinance'
5-
version = '4.0.6'
5+
version = '4.0.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 := "ch.postfinance",
44
name := "postfinancecheckout-java-sdk",
5-
version := "4.0.6",
5+
version := "4.0.7",
66
scalaVersion := "2.11.4",
77
scalacOptions ++= Seq("-feature"),
88
javacOptions in compile ++= Seq("-Xlint:deprecation"),

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<artifactId>postfinancecheckout-java-sdk</artifactId>
66
<packaging>jar</packaging>
77
<name>postfinancecheckout-java-sdk</name>
8-
<version>4.0.6</version>
9-
<url>https://www.postfinance.ch/checkout</url>
8+
<version>4.0.7</version>
9+
<url>https://postfinance.ch/en/business/products/e-commerce/postfinance-checkout-all-in-one.html</url>
1010
<description>The SDK for simplifying the integration with PostFinance Checkout API.</description>
1111
<scm>
1212
<connection>scm:git:[email protected]:pfpayments/java-sdk.git</connection>

src/main/java/ch/postfinance/sdk/model/AbstractTransactionPending.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import java.util.Arrays;
2424
import ch.postfinance.sdk.model.AddressCreate;
2525
import ch.postfinance.sdk.model.LineItemCreate;
26-
import ch.postfinance.sdk.model.PaymentMethodBrand;
2726
import ch.postfinance.sdk.model.TokenizationMode;
2827
import ch.postfinance.sdk.model.TransactionCompletionBehavior;
2928
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -45,7 +44,7 @@
4544
public class AbstractTransactionPending {
4645

4746
@JsonProperty("allowedPaymentMethodBrands")
48-
protected List<PaymentMethodBrand> allowedPaymentMethodBrands = null;
47+
protected List<Long> allowedPaymentMethodBrands = null;
4948

5049

5150
@JsonProperty("allowedPaymentMethodConfigurations")
@@ -121,12 +120,12 @@ public class AbstractTransactionPending {
121120

122121

123122

124-
public AbstractTransactionPending allowedPaymentMethodBrands(List<PaymentMethodBrand> allowedPaymentMethodBrands) {
123+
public AbstractTransactionPending allowedPaymentMethodBrands(List<Long> allowedPaymentMethodBrands) {
125124
this.allowedPaymentMethodBrands = allowedPaymentMethodBrands;
126125
return this;
127126
}
128127

129-
public AbstractTransactionPending addAllowedPaymentMethodBrandsItem(PaymentMethodBrand allowedPaymentMethodBrandsItem) {
128+
public AbstractTransactionPending addAllowedPaymentMethodBrandsItem(Long allowedPaymentMethodBrandsItem) {
130129
if (this.allowedPaymentMethodBrands == null) {
131130
this.allowedPaymentMethodBrands = new ArrayList<>();
132131
}
@@ -139,11 +138,11 @@ public AbstractTransactionPending addAllowedPaymentMethodBrandsItem(PaymentMetho
139138
* @return allowedPaymentMethodBrands
140139
**/
141140
@ApiModelProperty(value = "")
142-
public List<PaymentMethodBrand> getAllowedPaymentMethodBrands() {
141+
public List<Long> getAllowedPaymentMethodBrands() {
143142
return allowedPaymentMethodBrands;
144143
}
145144

146-
public void setAllowedPaymentMethodBrands(List<PaymentMethodBrand> allowedPaymentMethodBrands) {
145+
public void setAllowedPaymentMethodBrands(List<Long> allowedPaymentMethodBrands) {
147146
this.allowedPaymentMethodBrands = allowedPaymentMethodBrands;
148147
}
149148

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
/**
2+
* PostFinance Checkout SDK
3+
*
4+
* This library allows to interact with the PostFinance Checkout payment service.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
20+
package ch.postfinance.sdk.model;
21+
22+
import java.util.Objects;
23+
import java.util.Arrays;
24+
import ch.postfinance.sdk.model.InvoiceReimbursement;
25+
import com.fasterxml.jackson.annotation.JsonProperty;
26+
import com.fasterxml.jackson.annotation.JsonCreator;
27+
import com.fasterxml.jackson.annotation.JsonValue;
28+
import io.swagger.annotations.ApiModel;
29+
import io.swagger.annotations.ApiModelProperty;
30+
import java.util.*;
31+
import java.time.OffsetDateTime;
32+
33+
/**
34+
*
35+
*/
36+
@ApiModel(description = "")
37+
38+
public class InvoiceReimbursementWithRefundReference extends InvoiceReimbursement {
39+
40+
@JsonProperty("refundMerchantReference")
41+
protected String refundMerchantReference = null;
42+
43+
44+
45+
/**
46+
*
47+
* @return refundMerchantReference
48+
**/
49+
@ApiModelProperty(value = "")
50+
public String getRefundMerchantReference() {
51+
return refundMerchantReference;
52+
}
53+
54+
55+
56+
@Override
57+
public boolean equals(java.lang.Object o) {
58+
if (this == o) {
59+
return true;
60+
}
61+
if (o == null || getClass() != o.getClass()) {
62+
return false;
63+
}
64+
InvoiceReimbursementWithRefundReference invoiceReimbursementWithRefundReference = (InvoiceReimbursementWithRefundReference) o;
65+
return Objects.equals(this.amount, invoiceReimbursementWithRefundReference.amount) &&
66+
Objects.equals(this.createdOn, invoiceReimbursementWithRefundReference.createdOn) &&
67+
Objects.equals(this.currency, invoiceReimbursementWithRefundReference.currency) &&
68+
Objects.equals(this.discardedBy, invoiceReimbursementWithRefundReference.discardedBy) &&
69+
Objects.equals(this.discardedOn, invoiceReimbursementWithRefundReference.discardedOn) &&
70+
Objects.equals(this.id, invoiceReimbursementWithRefundReference.id) &&
71+
Objects.equals(this.linkedSpaceId, invoiceReimbursementWithRefundReference.linkedSpaceId) &&
72+
Objects.equals(this.paymentConnectorConfiguration, invoiceReimbursementWithRefundReference.paymentConnectorConfiguration) &&
73+
Objects.equals(this.paymentInitiationAdviceFile, invoiceReimbursementWithRefundReference.paymentInitiationAdviceFile) &&
74+
Objects.equals(this.processedBy, invoiceReimbursementWithRefundReference.processedBy) &&
75+
Objects.equals(this.processedOn, invoiceReimbursementWithRefundReference.processedOn) &&
76+
Objects.equals(this.recipientCity, invoiceReimbursementWithRefundReference.recipientCity) &&
77+
Objects.equals(this.recipientCountry, invoiceReimbursementWithRefundReference.recipientCountry) &&
78+
Objects.equals(this.recipientFamilyName, invoiceReimbursementWithRefundReference.recipientFamilyName) &&
79+
Objects.equals(this.recipientGivenName, invoiceReimbursementWithRefundReference.recipientGivenName) &&
80+
Objects.equals(this.recipientIban, invoiceReimbursementWithRefundReference.recipientIban) &&
81+
Objects.equals(this.recipientPostcode, invoiceReimbursementWithRefundReference.recipientPostcode) &&
82+
Objects.equals(this.recipientStreet, invoiceReimbursementWithRefundReference.recipientStreet) &&
83+
Objects.equals(this.senderIban, invoiceReimbursementWithRefundReference.senderIban) &&
84+
Objects.equals(this.state, invoiceReimbursementWithRefundReference.state) &&
85+
Objects.equals(this.version, invoiceReimbursementWithRefundReference.version) &&
86+
Objects.equals(this.refundMerchantReference, invoiceReimbursementWithRefundReference.refundMerchantReference) &&
87+
super.equals(o);
88+
}
89+
90+
@Override
91+
public int hashCode() {
92+
return Objects.hash(amount, createdOn, currency, discardedBy, discardedOn, id, linkedSpaceId, paymentConnectorConfiguration, paymentInitiationAdviceFile, processedBy, processedOn, recipientCity, recipientCountry, recipientFamilyName, recipientGivenName, recipientIban, recipientPostcode, recipientStreet, senderIban, state, version, refundMerchantReference, super.hashCode());
93+
}
94+
95+
96+
@Override
97+
public String toString() {
98+
StringBuilder sb = new StringBuilder();
99+
sb.append("class InvoiceReimbursementWithRefundReference {\n");
100+
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
101+
sb.append(" amount: ").append(toIndentedString(amount)).append("\n");
102+
sb.append(" createdOn: ").append(toIndentedString(createdOn)).append("\n");
103+
sb.append(" currency: ").append(toIndentedString(currency)).append("\n");
104+
sb.append(" discardedBy: ").append(toIndentedString(discardedBy)).append("\n");
105+
sb.append(" discardedOn: ").append(toIndentedString(discardedOn)).append("\n");
106+
sb.append(" id: ").append(toIndentedString(id)).append("\n");
107+
sb.append(" linkedSpaceId: ").append(toIndentedString(linkedSpaceId)).append("\n");
108+
sb.append(" paymentConnectorConfiguration: ").append(toIndentedString(paymentConnectorConfiguration)).append("\n");
109+
sb.append(" paymentInitiationAdviceFile: ").append(toIndentedString(paymentInitiationAdviceFile)).append("\n");
110+
sb.append(" processedBy: ").append(toIndentedString(processedBy)).append("\n");
111+
sb.append(" processedOn: ").append(toIndentedString(processedOn)).append("\n");
112+
sb.append(" recipientCity: ").append(toIndentedString(recipientCity)).append("\n");
113+
sb.append(" recipientCountry: ").append(toIndentedString(recipientCountry)).append("\n");
114+
sb.append(" recipientFamilyName: ").append(toIndentedString(recipientFamilyName)).append("\n");
115+
sb.append(" recipientGivenName: ").append(toIndentedString(recipientGivenName)).append("\n");
116+
sb.append(" recipientIban: ").append(toIndentedString(recipientIban)).append("\n");
117+
sb.append(" recipientPostcode: ").append(toIndentedString(recipientPostcode)).append("\n");
118+
sb.append(" recipientStreet: ").append(toIndentedString(recipientStreet)).append("\n");
119+
sb.append(" senderIban: ").append(toIndentedString(senderIban)).append("\n");
120+
sb.append(" state: ").append(toIndentedString(state)).append("\n");
121+
sb.append(" version: ").append(toIndentedString(version)).append("\n");
122+
sb.append(" refundMerchantReference: ").append(toIndentedString(refundMerchantReference)).append("\n");
123+
sb.append("}");
124+
return sb.toString();
125+
}
126+
127+
/**
128+
* Convert the given object to string with each line indented by 4 spaces
129+
* (except the first line).
130+
*/
131+
private String toIndentedString(java.lang.Object o) {
132+
if (o == null) {
133+
return "null";
134+
}
135+
return o.toString().replace("\n", "\n ");
136+
}
137+
138+
}
139+

src/main/java/ch/postfinance/sdk/model/Transaction.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import ch.postfinance.sdk.model.FailureReason;
2929
import ch.postfinance.sdk.model.LineItem;
3030
import ch.postfinance.sdk.model.PaymentConnectorConfiguration;
31-
import ch.postfinance.sdk.model.PaymentMethodBrand;
3231
import ch.postfinance.sdk.model.PaymentTerminal;
3332
import ch.postfinance.sdk.model.Token;
3433
import ch.postfinance.sdk.model.TokenizationMode;
@@ -67,7 +66,7 @@ public class Transaction {
6766

6867

6968
@JsonProperty("allowedPaymentMethodBrands")
70-
protected List<PaymentMethodBrand> allowedPaymentMethodBrands = null;
69+
protected List<Long> allowedPaymentMethodBrands = null;
7170

7271

7372
@JsonProperty("allowedPaymentMethodConfigurations")
@@ -364,7 +363,7 @@ public String getAcceptLanguageHeader() {
364363
* @return allowedPaymentMethodBrands
365364
**/
366365
@ApiModelProperty(value = "")
367-
public List<PaymentMethodBrand> getAllowedPaymentMethodBrands() {
366+
public List<Long> getAllowedPaymentMethodBrands() {
368367
return allowedPaymentMethodBrands;
369368
}
370369

src/main/java/ch/postfinance/sdk/service/InvoiceReimbursementService.java

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import ch.postfinance.sdk.model.EntityQuery;
77
import ch.postfinance.sdk.model.EntityQueryFilter;
88
import ch.postfinance.sdk.model.InvoiceReimbursement;
9+
import ch.postfinance.sdk.model.InvoiceReimbursementWithRefundReference;
910
import ch.postfinance.sdk.model.ServerError;
1011

1112
import com.fasterxml.jackson.core.type.TypeReference;
@@ -323,20 +324,20 @@ public HttpResponse readForHttpResponse(Long spaceId, Long id, Map<String, Objec
323324
* <p><b>542</b> - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request.
324325
* @param spaceId
325326
* @param query The query restricts the invoice reimbursements which are returned by the search.
326-
* @return List&lt;InvoiceReimbursement&gt;
327+
* @return List&lt;InvoiceReimbursementWithRefundReference&gt;
327328
* @throws IOException if an error occurs while attempting to invoke the API
328329
* For more information visit this link.
329330
* @see <a href="https://checkout.postfinance.ch/doc/api/web-service#invoice-reimbursement-service--search">Search Documentation</a>
330331
331332
**/
332-
public List<InvoiceReimbursement> search(Long spaceId, EntityQuery query) throws IOException {
333+
public List<InvoiceReimbursementWithRefundReference> search(Long spaceId, EntityQuery query) throws IOException {
333334
HttpResponse response = searchForHttpResponse(spaceId, query);
334-
String returnType = "List&lt;InvoiceReimbursement&gt;";
335+
String returnType = "List&lt;InvoiceReimbursementWithRefundReference&gt;";
335336
if(returnType.equals("String")){
336-
return (List<InvoiceReimbursement>) (Object) response.parseAsString();
337+
return (List<InvoiceReimbursementWithRefundReference>) (Object) response.parseAsString();
337338
}
338-
TypeReference typeRef = new TypeReference<List<InvoiceReimbursement>>() {};
339-
return (List<InvoiceReimbursement>)apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
339+
TypeReference typeRef = new TypeReference<List<InvoiceReimbursementWithRefundReference>>() {};
340+
return (List<InvoiceReimbursementWithRefundReference>)apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
340341
}
341342

342343
/**
@@ -348,20 +349,20 @@ public List<InvoiceReimbursement> search(Long spaceId, EntityQuery query) throws
348349
* @param spaceId
349350
* @param query The query restricts the invoice reimbursements which are returned by the search.
350351
* @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param.
351-
* @return List&lt;InvoiceReimbursement&gt;
352+
* @return List&lt;InvoiceReimbursementWithRefundReference&gt;
352353
* @throws IOException if an error occurs while attempting to invoke the API
353354
* For more information visit this link.
354355
* @see <a href="https://checkout.postfinance.ch/doc/api/web-service#invoice-reimbursement-service--search">Search Documentation</a>
355356
356357
**/
357-
public List<InvoiceReimbursement> search(Long spaceId, EntityQuery query, Map<String, Object> params) throws IOException {
358+
public List<InvoiceReimbursementWithRefundReference> search(Long spaceId, EntityQuery query, Map<String, Object> params) throws IOException {
358359
HttpResponse response = searchForHttpResponse(spaceId, query, params);
359-
String returnType = "List&lt;InvoiceReimbursement&gt;";
360+
String returnType = "List&lt;InvoiceReimbursementWithRefundReference&gt;";
360361
if(returnType.equals("String")){
361-
return (List<InvoiceReimbursement>) (Object) response.parseAsString();
362+
return (List<InvoiceReimbursementWithRefundReference>) (Object) response.parseAsString();
362363
}
363-
TypeReference typeRef = new TypeReference<List<InvoiceReimbursement>>() {};
364-
return (List<InvoiceReimbursement>)apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
364+
TypeReference typeRef = new TypeReference<List<InvoiceReimbursementWithRefundReference>>() {};
365+
return (List<InvoiceReimbursementWithRefundReference>)apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
365366
}
366367

367368
public HttpResponse searchForHttpResponse(Long spaceId, EntityQuery query) throws IOException {

0 commit comments

Comments
 (0)