Skip to content

Commit

Permalink
Release 1.0.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
WorldlineAcquiring committed Dec 11, 2024
1 parent 18ddec7 commit aea6045
Show file tree
Hide file tree
Showing 64 changed files with 4,460 additions and 134 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.worldline-solutions.acquiring</groupId>
<artifactId>acquiring-sdk-java</artifactId>
<version>0.1.0</version>
<version>1.0.0</version>
<packaging>jar</packaging>

<name>acquiring-sdk-java</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import com.worldline.acquiring.sdk.java.ApiResource;
import com.worldline.acquiring.sdk.java.v1.acquirer.merchant.accountverifications.AccountVerificationsClient;
import com.worldline.acquiring.sdk.java.v1.acquirer.merchant.balanceinquiries.BalanceInquiriesClient;
import com.worldline.acquiring.sdk.java.v1.acquirer.merchant.dynamiccurrencyconversion.DynamicCurrencyConversionClient;
import com.worldline.acquiring.sdk.java.v1.acquirer.merchant.payments.PaymentsClient;
import com.worldline.acquiring.sdk.java.v1.acquirer.merchant.refunds.RefundsClient;
Expand Down Expand Up @@ -49,6 +50,15 @@ public AccountVerificationsClient accountVerifications() {
return new AccountVerificationsClient(this, null);
}

/**
* Resource /processing/v1/{acquirerId}/{merchantId}/balance-inquiries
*
* @return BalanceInquiriesClient
*/
public BalanceInquiriesClient balanceInquiries() {
return new BalanceInquiriesClient(this, null);
}

/**
* Resource /processing/v1/{acquirerId}/{merchantId}/operations/{operationId}/reverse
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/*
* This file was automatically generated.
*/

package com.worldline.acquiring.sdk.java.v1.acquirer.merchant.balanceinquiries;

import java.util.Map;

import com.worldline.acquiring.sdk.java.ApiResource;
import com.worldline.acquiring.sdk.java.CallContext;
import com.worldline.acquiring.sdk.java.communication.ResponseException;
import com.worldline.acquiring.sdk.java.v1.ApiException;
import com.worldline.acquiring.sdk.java.v1.AuthorizationException;
import com.worldline.acquiring.sdk.java.v1.ExceptionFactory;
import com.worldline.acquiring.sdk.java.v1.PlatformException;
import com.worldline.acquiring.sdk.java.v1.ReferenceException;
import com.worldline.acquiring.sdk.java.v1.ValidationException;
import com.worldline.acquiring.sdk.java.v1.domain.ApiBalanceInquiryRequest;
import com.worldline.acquiring.sdk.java.v1.domain.ApiBalanceInquiryResponse;
import com.worldline.acquiring.sdk.java.v1.domain.ApiPaymentErrorResponse;

/**
* BalanceInquiries client. Thread-safe.
*/
public class BalanceInquiriesClient extends ApiResource {

private static final ExceptionFactory EXCEPTION_FACTORY = new ExceptionFactory();

public BalanceInquiriesClient(ApiResource parent, Map<String, String> pathContext) {
super(parent, pathContext);
}

/**
* Resource /processing/v1/{acquirerId}/{merchantId}/balance-inquiries
* - <a href="https://docs.acquiring.worldline-solutions.com/api-reference#tag/Balance-Inquiries/operation/processBalanceInquiry">Balance inquiry</a>
*
* @param body ApiBalanceInquiryRequest
* @return ApiBalanceInquiryResponse
* @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400)
* @throws AuthorizationException if the request was not allowed (HTTP status code 403)
* @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed,
* or there was a conflict (HTTP status code 404, 409 or 410)
* @throws PlatformException if something went wrong at the Worldline Acquiring platform,
* the Worldline Acquiring platform was unable to process a message from a downstream partner/acquirer,
* or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
* @throws ApiException if the Worldline Acquiring platform returned any other error
*/
public ApiBalanceInquiryResponse processBalanceInquiry(ApiBalanceInquiryRequest body) {
return processBalanceInquiry(body, null);
}

/**
* Resource /processing/v1/{acquirerId}/{merchantId}/balance-inquiries
* - <a href="https://docs.acquiring.worldline-solutions.com/api-reference#tag/Balance-Inquiries/operation/processBalanceInquiry">Balance inquiry</a>
*
* @param body ApiBalanceInquiryRequest
* @param context CallContext
* @return ApiBalanceInquiryResponse
* @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400)
* @throws AuthorizationException if the request was not allowed (HTTP status code 403)
* @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed,
* or there was a conflict (HTTP status code 404, 409 or 410)
* @throws PlatformException if something went wrong at the Worldline Acquiring platform,
* the Worldline Acquiring platform was unable to process a message from a downstream partner/acquirer,
* or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
* @throws ApiException if the Worldline Acquiring platform returned any other error
*/
public ApiBalanceInquiryResponse processBalanceInquiry(ApiBalanceInquiryRequest body, CallContext context) {
String uri = instantiateUri("/processing/v1/{acquirerId}/{merchantId}/balance-inquiries", null);
try {
return communicator.post(
uri,
null,
null,
body,
ApiBalanceInquiryResponse.class,
context);
} catch (ResponseException e) {
final Class<?> errorType = ApiPaymentErrorResponse.class;
final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), errorType);
throw EXCEPTION_FACTORY.createException(e.getStatusCode(), e.getBody(), errorObject, context);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ public void setReturnOperations(Boolean value) {
this.returnOperations = value;
}

/**
* If true, the response will contain the operations of the payment.
* False by default.
*/
public GetPaymentStatusParams withReturnOperations(Boolean value) {
this.returnOperations = value;
return this;
}

@Override
public List<RequestParam> toRequestParameters() {
List<RequestParam> result = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ public void setReturnOperations(Boolean value) {
this.returnOperations = value;
}

/**
* If true, the response will contain the operations of the payment.
* False by default.
*/
public GetRefundParams withReturnOperations(Boolean value) {
this.returnOperations = value;
return this;
}

@Override
public List<RequestParam> toRequestParameters() {
List<RequestParam> result = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ public void setCardholderAddress(String value) {
this.cardholderAddress = value;
}

/**
* Cardholder street address
*/
public AddressVerificationData withCardholderAddress(String value) {
this.cardholderAddress = value;
return this;
}

/**
* Cardholder postal code, should be provided without spaces
*/
Expand All @@ -37,4 +45,12 @@ public String getCardholderPostalCode() {
public void setCardholderPostalCode(String value) {
this.cardholderPostalCode = value;
}

/**
* Cardholder postal code, should be provided without spaces
*/
public AddressVerificationData withCardholderPostalCode(String value) {
this.cardholderPostalCode = value;
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class AmountData {
/**
* Amount of transaction formatted according to card scheme
* specifications.
* E.g. 100 for 1.00 EUR. Either this or amount must be present.
* E.g. 100 for 1.00 EUR.
*/
public Long getAmount() {
return amount;
Expand All @@ -24,12 +24,22 @@ public Long getAmount() {
/**
* Amount of transaction formatted according to card scheme
* specifications.
* E.g. 100 for 1.00 EUR. Either this or amount must be present.
* E.g. 100 for 1.00 EUR.
*/
public void setAmount(Long value) {
this.amount = value;
}

/**
* Amount of transaction formatted according to card scheme
* specifications.
* E.g. 100 for 1.00 EUR.
*/
public AmountData withAmount(Long value) {
this.amount = value;
return this;
}

/**
* Alpha-numeric ISO 4217 currency code for transaction, e.g. EUR
*/
Expand All @@ -44,6 +54,14 @@ public void setCurrencyCode(String value) {
this.currencyCode = value;
}

/**
* Alpha-numeric ISO 4217 currency code for transaction, e.g. EUR
*/
public AmountData withCurrencyCode(String value) {
this.currencyCode = value;
return this;
}

/**
* Number of decimals in the amount
*/
Expand All @@ -57,4 +75,12 @@ public Integer getNumberOfDecimals() {
public void setNumberOfDecimals(Integer value) {
this.numberOfDecimals = value;
}

/**
* Number of decimals in the amount
*/
public AmountData withNumberOfDecimals(Integer value) {
this.numberOfDecimals = value;
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ public class ApiAccountVerificationRequest {

private PaymentReferences references;

private TerminalData terminalData;

private ZonedDateTime transactionTimestamp;

/**
Expand All @@ -32,6 +34,14 @@ public void setCardPaymentData(CardPaymentDataForVerification value) {
this.cardPaymentData = value;
}

/**
* Card data
*/
public ApiAccountVerificationRequest withCardPaymentData(CardPaymentDataForVerification value) {
this.cardPaymentData = value;
return this;
}

/**
* Merchant Data
*/
Expand All @@ -46,6 +56,14 @@ public void setMerchant(MerchantData value) {
this.merchant = value;
}

/**
* Merchant Data
*/
public ApiAccountVerificationRequest withMerchant(MerchantData value) {
this.merchant = value;
return this;
}

/**
* A globally unique identifier of the operation, generated by you.<br>
* We advise you to submit a UUID or an identifier composed of an arbitrary string
Expand All @@ -68,6 +86,18 @@ public void setOperationId(String value) {
this.operationId = value;
}

/**
* A globally unique identifier of the operation, generated by you.<br>
* We advise you to submit a UUID or an identifier composed of an arbitrary string
* and a UUID/URL-safe Base64 UUID (RFC 4648 §5).<br>
* It's used to detect duplicate requests or to reference an operation in
* technical reversals.
*/
public ApiAccountVerificationRequest withOperationId(String value) {
this.operationId = value;
return this;
}

/**
* Payment References
*/
Expand All @@ -82,6 +112,27 @@ public void setReferences(PaymentReferences value) {
this.references = value;
}

/**
* Payment References
*/
public ApiAccountVerificationRequest withReferences(PaymentReferences value) {
this.references = value;
return this;
}

public TerminalData getTerminalData() {
return terminalData;
}

public void setTerminalData(TerminalData value) {
this.terminalData = value;
}

public ApiAccountVerificationRequest withTerminalData(TerminalData value) {
this.terminalData = value;
return this;
}

/**
* Timestamp of transaction in ISO 8601 format (YYYY-MM-DDThh:mm:ss+TZD)<br>
* It can be expressed in merchant time zone (ex: 2023-10-10T08:00+02:00)
Expand All @@ -99,4 +150,14 @@ public ZonedDateTime getTransactionTimestamp() {
public void setTransactionTimestamp(ZonedDateTime value) {
this.transactionTimestamp = value;
}

/**
* Timestamp of transaction in ISO 8601 format (YYYY-MM-DDThh:mm:ss+TZD)<br>
* It can be expressed in merchant time zone (ex: 2023-10-10T08:00+02:00)
* or in UTC (ex: 2023-10-10T08:00Z)
*/
public ApiAccountVerificationRequest withTransactionTimestamp(ZonedDateTime value) {
this.transactionTimestamp = value;
return this;
}
}
Loading

0 comments on commit aea6045

Please sign in to comment.