Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Changelog
All notable changes to this project will be documented in this file.

## [3.1.4]
- Added new method to Merchant API `authenticate`

## [3.1.3]
- Enhanced interface of the endpoint cardWallet/authorize to pass payment identifier created in the previous step of setting wallet session
- Change `CreateCheckoutSessionRequest` to be `PaymentRequest` based
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ For integrating Java projects with the AltaPay gateway.
<dependency>
<groupId>com.altapay</groupId>
<artifactId>sdk-java</artifactId>
<version>3.1.3</version>
<version>3.1.4</version>
</dependency>

### Gradle

implementation 'com.altapay:sdk-java:3.1.3'
implementation 'com.altapay:sdk-java:3.1.4'

## Changelog

Expand Down
10 changes: 10 additions & 0 deletions src/main/java/com/pensio/api/PensioMerchantAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.pensio.api.generated.Session;
import com.pensio.api.request.*;

import com.pensio.response.AuthenticationResponse;
import com.pensio.response.CheckoutSessionResponse;
import jakarta.xml.bind.JAXBElement;
import jakarta.xml.bind.JAXBException;
Expand Down Expand Up @@ -35,6 +36,15 @@ public boolean login() throws PensioAPIException
new HashMap<>());
return "OK".equals(response.getBody().getResult());
}

public AuthenticationResponse authenticate() throws PensioAPIException
{
APIResponse response = getAPIResponse("login",
HttpMethod.POST,
new HashMap<>());

return new AuthenticationResponse("OK".equals(response.getBody().getResult()), response.getVersion());
}

public PaymentRequestResponse createPaymentRequest(PaymentRequest paymentRequest) throws PensioAPIException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@

import java.util.List;

public class CreateCheckoutSessionRequest extends PaymentRequest {
public class CreateCheckoutSessionRequest extends PaymentRequest<CreateCheckoutSessionRequest> {

private List<String> terminals;

public CreateCheckoutSessionRequest() {
}

public List<String> getTerminals() {
return terminals;
}
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/pensio/response/AuthenticationResponse.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package com.pensio.response;

public record AuthenticationResponse(boolean authenticated, String version) {
}