Skip to content

Commit

Permalink
Release 2.2.23
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Hunziker committed Mar 15, 2021
1 parent 7a81854 commit 3f57707
Show file tree
Hide file tree
Showing 7 changed files with 227 additions and 8 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.wallee</groupId>
<artifactId>wallee-java-sdk</artifactId>
<version>2.2.22</version>
<version>2.2.23</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.wallee:wallee-java-sdk:2.2.22"
compile "com.wallee:wallee-java-sdk:2.2.23"
```

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

Then manually install the following JARs:

* `target/wallee-java-sdk-2.2.22.jar`
* `target/wallee-java-sdk-2.2.23.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.wallee'
version = '2.2.22'
version = '2.2.23'

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.wallee",
name := "wallee-java-sdk",
version := "2.2.22",
version := "2.2.23",
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>wallee-java-sdk</artifactId>
<packaging>jar</packaging>
<name>wallee-java-sdk</name>
<version>2.2.22</version>
<version>2.2.23</version>
<url>https://www.wallee.com</url>
<description>The SDK for simplifying the integration with wallee API.</description>
<scm>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ public class AuthenticatedCardDataCreate {
protected RecurringIndicator recurringIndicator = null;


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


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

Expand Down Expand Up @@ -205,6 +209,25 @@ public void setRecurringIndicator(RecurringIndicator recurringIndicator) {
}


public AuthenticatedCardDataCreate schemeTransactionReference(String schemeTransactionReference) {
this.schemeTransactionReference = schemeTransactionReference;
return this;
}

/**
*
* @return schemeTransactionReference
**/
@ApiModelProperty(value = "")
public String getSchemeTransactionReference() {
return schemeTransactionReference;
}

public void setSchemeTransactionReference(String schemeTransactionReference) {
this.schemeTransactionReference = schemeTransactionReference;
}


public AuthenticatedCardDataCreate tokenRequestorId(String tokenRequestorId) {
this.tokenRequestorId = tokenRequestorId;
return this;
Expand Down Expand Up @@ -241,12 +264,13 @@ public boolean equals(java.lang.Object o) {
Objects.equals(this.expiryDate, authenticatedCardDataCreate.expiryDate) &&
Objects.equals(this.primaryAccountNumber, authenticatedCardDataCreate.primaryAccountNumber) &&
Objects.equals(this.recurringIndicator, authenticatedCardDataCreate.recurringIndicator) &&
Objects.equals(this.schemeTransactionReference, authenticatedCardDataCreate.schemeTransactionReference) &&
Objects.equals(this.tokenRequestorId, authenticatedCardDataCreate.tokenRequestorId);
}

@Override
public int hashCode() {
return Objects.hash(cardHolderName, cardVerificationCode, cardholderAuthentication, cryptogram, expiryDate, primaryAccountNumber, recurringIndicator, tokenRequestorId);
return Objects.hash(cardHolderName, cardVerificationCode, cardholderAuthentication, cryptogram, expiryDate, primaryAccountNumber, recurringIndicator, schemeTransactionReference, tokenRequestorId);
}


Expand All @@ -262,6 +286,7 @@ public String toString() {
sb.append(" expiryDate: ").append(toIndentedString(expiryDate)).append("\n");
sb.append(" primaryAccountNumber: ").append(toIndentedString(primaryAccountNumber)).append("\n");
sb.append(" recurringIndicator: ").append(toIndentedString(recurringIndicator)).append("\n");
sb.append(" schemeTransactionReference: ").append(toIndentedString(schemeTransactionReference)).append("\n");
sb.append(" tokenRequestorId: ").append(toIndentedString(tokenRequestorId)).append("\n");
sb.append("}");
return sb.toString();
Expand Down
27 changes: 26 additions & 1 deletion src/main/java/com/wallee/sdk/model/TokenizedCardDataCreate.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ public class TokenizedCardDataCreate {
protected RecurringIndicator recurringIndicator = null;


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


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

Expand Down Expand Up @@ -181,6 +185,25 @@ public void setRecurringIndicator(RecurringIndicator recurringIndicator) {
}


public TokenizedCardDataCreate schemeTransactionReference(String schemeTransactionReference) {
this.schemeTransactionReference = schemeTransactionReference;
return this;
}

/**
*
* @return schemeTransactionReference
**/
@ApiModelProperty(value = "")
public String getSchemeTransactionReference() {
return schemeTransactionReference;
}

public void setSchemeTransactionReference(String schemeTransactionReference) {
this.schemeTransactionReference = schemeTransactionReference;
}


public TokenizedCardDataCreate tokenRequestorId(String tokenRequestorId) {
this.tokenRequestorId = tokenRequestorId;
return this;
Expand Down Expand Up @@ -216,12 +239,13 @@ public boolean equals(java.lang.Object o) {
Objects.equals(this.expiryDate, tokenizedCardDataCreate.expiryDate) &&
Objects.equals(this.primaryAccountNumber, tokenizedCardDataCreate.primaryAccountNumber) &&
Objects.equals(this.recurringIndicator, tokenizedCardDataCreate.recurringIndicator) &&
Objects.equals(this.schemeTransactionReference, tokenizedCardDataCreate.schemeTransactionReference) &&
Objects.equals(this.tokenRequestorId, tokenizedCardDataCreate.tokenRequestorId);
}

@Override
public int hashCode() {
return Objects.hash(cardHolderName, cardVerificationCode, cryptogram, expiryDate, primaryAccountNumber, recurringIndicator, tokenRequestorId);
return Objects.hash(cardHolderName, cardVerificationCode, cryptogram, expiryDate, primaryAccountNumber, recurringIndicator, schemeTransactionReference, tokenRequestorId);
}


Expand All @@ -236,6 +260,7 @@ public String toString() {
sb.append(" expiryDate: ").append(toIndentedString(expiryDate)).append("\n");
sb.append(" primaryAccountNumber: ").append(toIndentedString(primaryAccountNumber)).append("\n");
sb.append(" recurringIndicator: ").append(toIndentedString(recurringIndicator)).append("\n");
sb.append(" schemeTransactionReference: ").append(toIndentedString(schemeTransactionReference)).append("\n");
sb.append(" tokenRequestorId: ").append(toIndentedString(tokenRequestorId)).append("\n");
sb.append("}");
return sb.toString();
Expand Down
169 changes: 169 additions & 0 deletions src/main/java/com/wallee/sdk/service/PaymentTerminalTillService.java
Original file line number Diff line number Diff line change
Expand Up @@ -203,4 +203,173 @@ public HttpResponse performTransactionForHttpResponse(Long spaceId, Long transac
return httpRequest.execute();
}

/**
* Perform Payment Terminal Transaction (using TID)
* Starts a payment terminal transaction and waits for its completion. If the call returns with a long polling timeout status, you may try again. The processing of the transaction will be picked up where it was left off.
* <p><b>200</b> - This status code indicates that a client request was successfully received, understood, and accepted.
* <p><b>409</b> - This status code indicates that there was a conflict with the current version of the data in the database and the provided data in the request.
* <p><b>442</b> - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error.
* <p><b>542</b> - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request.
* <p><b>543</b> - This status code indicates that the long polling request timed out.
* @param spaceId
* @param transactionId The ID of the transaction which is used to process with the terminal.
* @param terminalIdentifier The identifier (aka TID) of the terminal which should be used to process the transaction.
* @param language The language in which the messages should be rendered in.
* @return Transaction
* @throws IOException if an error occurs while attempting to invoke the API
* For more information visit this link.
* @see <a href="https://app-wallee.com/doc/api/web-service#payment-terminal-till-service--perform-transaction-by-identifier">Perform Payment Terminal Transaction (using TID) Documentation</a>
**/
public Transaction performTransactionByIdentifier(Long spaceId, Long transactionId, String terminalIdentifier, String language) throws IOException {
HttpResponse response = performTransactionByIdentifierForHttpResponse(spaceId, transactionId, terminalIdentifier, language);
String returnType = "Transaction";
if(returnType.equals("String")){
return (Transaction) (Object) response.parseAsString();
}
TypeReference typeRef = new TypeReference<Transaction>() {};
return (Transaction)apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
}

/**
* Perform Payment Terminal Transaction (using TID)
* Starts a payment terminal transaction and waits for its completion. If the call returns with a long polling timeout status, you may try again. The processing of the transaction will be picked up where it was left off.
* <p><b>200</b> - This status code indicates that a client request was successfully received, understood, and accepted.
* <p><b>409</b> - This status code indicates that there was a conflict with the current version of the data in the database and the provided data in the request.
* <p><b>442</b> - This status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error.
* <p><b>542</b> - This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the client request.
* <p><b>543</b> - This status code indicates that the long polling request timed out.
* @param spaceId
* @param transactionId The ID of the transaction which is used to process with the terminal.
* @param terminalIdentifier The identifier (aka TID) of the terminal which should be used to process the transaction.
* @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param.
* @return Transaction
* @throws IOException if an error occurs while attempting to invoke the API
* For more information visit this link.
* @see <a href="https://app-wallee.com/doc/api/web-service#payment-terminal-till-service--perform-transaction-by-identifier">Perform Payment Terminal Transaction (using TID) Documentation</a>
**/
public Transaction performTransactionByIdentifier(Long spaceId, Long transactionId, String terminalIdentifier, Map<String, Object> params) throws IOException {
HttpResponse response = performTransactionByIdentifierForHttpResponse(spaceId, transactionId, terminalIdentifier, params);
String returnType = "Transaction";
if(returnType.equals("String")){
return (Transaction) (Object) response.parseAsString();
}
TypeReference typeRef = new TypeReference<Transaction>() {};
return (Transaction)apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
}

public HttpResponse performTransactionByIdentifierForHttpResponse(Long spaceId, Long transactionId, String terminalIdentifier, String language) throws IOException {
// verify the required parameter 'spaceId' is set
if (spaceId == null) {
throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling performTransactionByIdentifier");
}// verify the required parameter 'transactionId' is set
if (transactionId == null) {
throw new IllegalArgumentException("Missing the required parameter 'transactionId' when calling performTransactionByIdentifier");
}// verify the required parameter 'terminalIdentifier' is set
if (terminalIdentifier == null) {
throw new IllegalArgumentException("Missing the required parameter 'terminalIdentifier' when calling performTransactionByIdentifier");
}
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/payment-terminal-till/perform-transaction-by-identifier");
if (spaceId != null) {
String key = "spaceId";
Object value = spaceId;
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
uriBuilder = uriBuilder.queryParam(key, value);
}
} if (transactionId != null) {
String key = "transactionId";
Object value = transactionId;
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
uriBuilder = uriBuilder.queryParam(key, value);
}
} if (terminalIdentifier != null) {
String key = "terminalIdentifier";
Object value = terminalIdentifier;
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
uriBuilder = uriBuilder.queryParam(key, value);
}
} if (language != null) {
String key = "language";
Object value = language;
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
uriBuilder = uriBuilder.queryParam(key, value);
}
}

String url = uriBuilder.build().toString();
GenericUrl genericUrl = new GenericUrl(url);

HttpContent content = null;
HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content);
httpRequest.getHeaders().setContentType("application/json;charset=utf-8");
httpRequest.setReadTimeout(90 * 1000);

return httpRequest.execute();
}

public HttpResponse performTransactionByIdentifierForHttpResponse(Long spaceId, Long transactionId, String terminalIdentifier, Map<String, Object> params) throws IOException {
// verify the required parameter 'spaceId' is set
if (spaceId == null) {
throw new IllegalArgumentException("Missing the required parameter 'spaceId' when calling performTransactionByIdentifier");
}// verify the required parameter 'transactionId' is set
if (transactionId == null) {
throw new IllegalArgumentException("Missing the required parameter 'transactionId' when calling performTransactionByIdentifier");
}// verify the required parameter 'terminalIdentifier' is set
if (terminalIdentifier == null) {
throw new IllegalArgumentException("Missing the required parameter 'terminalIdentifier' when calling performTransactionByIdentifier");
}
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/payment-terminal-till/perform-transaction-by-identifier");

// Copy the params argument if present, to allow passing in immutable maps
Map<String, Object> allParams = params == null ? new HashMap<String, Object>() : new HashMap<String, Object>(params);
// Add the required query param 'spaceId' to the map of query params
allParams.put("spaceId", spaceId);
// Add the required query param 'transactionId' to the map of query params
allParams.put("transactionId", transactionId);
// Add the required query param 'terminalIdentifier' to the map of query params
allParams.put("terminalIdentifier", terminalIdentifier);

for (Map.Entry<String, Object> entryMap: allParams.entrySet()) {
String key = entryMap.getKey();
Object value = entryMap.getValue();

if (key != null && value != null) {
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
uriBuilder = uriBuilder.queryParam(key, value);
}
}
}

String url = uriBuilder.build().toString();
GenericUrl genericUrl = new GenericUrl(url);

HttpContent content = null;
HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content);
httpRequest.getHeaders().setContentType("application/json;charset=utf-8");
httpRequest.setReadTimeout(90 * 1000);

return httpRequest.execute();
}

}

0 comments on commit 3f57707

Please sign in to comment.