Skip to content

Commit 3207db6

Browse files
OctopusDeploy release: 14.2.21
1 parent b242662 commit 3207db6

File tree

20 files changed

+687
-24
lines changed

20 files changed

+687
-24
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Changelog
22

3-
## Latest Version - V14.2.20 (05/29/2025)
3+
## Latest Version - V14.2.21 (06/03/2025)
4+
### Bug Fixes
5+
- [Portico] - Updated the condition where clientTransactionId should not be added as part of CreditAddToBatch tag for Capture transactions.
6+
- [GPAPI] - Created New API "/installments"
7+
8+
## V14.2.20 (05/29/2025)
49
### Enhancements
510
- [GPApi] - Added Installment Object in Create Sale API (POST /transactions)
611
- [GPApi] - Added Installment Object in Reporting API (GET /transactions & GET /transactions/{id})

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>com.heartlandpaymentsystems</groupId>
55
<artifactId>globalpayments-sdk</artifactId>
6-
<version>14.2.20</version>
6+
<version>14.2.21</version>
77
<packaging>jar</packaging>
88
<name>Heartland &amp; Global Payments SDK</name>
99
<description>API for processing payments through Global Payments</description>

src/main/java/com/global/api/ConfiguredServices.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package com.global.api;
22

3-
import com.global.api.gateways.IFileProcessingService;
43
import com.global.api.entities.enums.Secure3dVersion;
54
import com.global.api.entities.exceptions.ConfigurationException;
65
import com.global.api.gateways.*;
6+
import com.global.api.services.InstallmentService;
77
import com.global.api.terminals.DeviceController;
88
import com.global.api.terminals.abstractions.IDeviceInterface;
99
import com.global.api.terminals.abstractions.IDisposable;
@@ -28,6 +28,7 @@ public class ConfiguredServices implements IDisposable {
2828
@Getter @Setter
2929
private IProPayProvider proPayProvider;
3030
@Getter @Setter private IPayFacProvider payFacProvider;
31+
@Getter @Setter private IInstallmentService installmentService;
3132

3233

3334
IPaymentGateway getGatewayConnector() {

src/main/java/com/global/api/ServicesContainer.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,14 @@ public IPayFacProvider getPayFac(String configName) throws ConfigurationExceptio
9292

9393
throw new ConfigurationException("PayFacProvider is not configured");
9494
}
95+
public IInstallmentService getInstallmentClient(String configName) throws ApiException {
96+
if (configurations.containsKey(configName)) {
97+
return configurations.get(configName).getInstallmentService();
98+
}
99+
100+
throw new ApiException("The specified configuration has not been configured for installment processing.");
101+
}
102+
95103

96104
public static ServicesContainer getInstance() {
97105
if(instance == null)

src/main/java/com/global/api/builders/BillingBuilder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public BillingBuilder withBills(Bill ... bills) {
9292
this.bills = Arrays.asList(bills);
9393
return this;
9494
}
95-
95+
9696
public BillingBuilder withBills(List<Bill> bills) {
9797
this.bills = bills;
9898
return this;
@@ -138,6 +138,6 @@ public BillingResponse execute(String configName) throws ApiException {
138138

139139
@Override
140140
public void setupValidations() {
141-
//
141+
//
142142
}
143143
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
package com.global.api.builders;
2+
3+
import com.global.api.ServicesContainer;
4+
import com.global.api.entities.IInstallmentEntity;
5+
import com.global.api.entities.exceptions.ApiException;
6+
import com.global.api.gateways.IInstallmentService;
7+
import com.global.api.paymentMethods.Installment;
8+
import lombok.Getter;
9+
import lombok.Setter;
10+
11+
@Getter
12+
@Setter
13+
public abstract class InstallmentBuilder extends BaseBuilder<Installment> {
14+
15+
/**
16+
* Represents the Installment entity
17+
*/
18+
private IInstallmentEntity entity;
19+
20+
/**
21+
* Represents the parameterized constructor to set the installment Entity value
22+
*
23+
* @param entity
24+
*/
25+
public InstallmentBuilder(IInstallmentEntity entity) {
26+
27+
if (entity != null) {
28+
this.entity = entity;
29+
}
30+
}
31+
32+
/**
33+
* Executes the Installment builder against the gateway.
34+
*
35+
* @param configName
36+
* @return {@link Installment}
37+
* @throws ApiException
38+
*/
39+
public Installment execute(String configName) throws ApiException {
40+
super.execute(configName);
41+
IInstallmentService installmentClient = ServicesContainer.getInstance().getInstallmentClient(configName);
42+
return installmentClient.processInstallment(this);
43+
}
44+
}

src/main/java/com/global/api/builders/ProPayBuilder.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,30 +45,30 @@ public class ProPayBuilder extends BaseBuilder<Transaction>{
4545
public CreditCardData creditCardData;
4646
public BankAccountData aCHInofmation;
4747
public Address mailingAddressInofmation;
48-
public BankAccountData secondaryBankInofmation;
48+
public BankAccountData secondaryBankInofmation;
4949
public GrossBillingInformation grossBillingInformation;
50-
public String negativeLimit;
51-
public RenewAccountData renewalAccountData;
52-
public String accountNumber;
53-
public String password;
54-
public AccountPermissions accountPermissions;
55-
public BankAccountOwnershipData primaryBankAccountOwner;
56-
public BankAccountOwnershipData secondaryBankAccountOwner;
50+
public String negativeLimit;
51+
public RenewAccountData renewalAccountData;
52+
public String accountNumber;
53+
public String password;
54+
public AccountPermissions accountPermissions;
55+
public BankAccountOwnershipData primaryBankAccountOwner;
56+
public BankAccountOwnershipData secondaryBankAccountOwner;
5757
public DocumentUploadData documentUploadData;
5858
public SSORequestData sSORequestData;
5959
public OrderDevice orderDevice;
6060

61-
public String amount;
62-
public String receivingAccountNumber;
61+
public String amount;
62+
public String receivingAccountNumber;
6363
public Boolean allowPending;
64-
public String cCAmount;
64+
public String cCAmount;
6565
public Boolean requireCCRefund;
66-
public String transNum;
66+
public String transNum;
6767

68-
public String externalID;
69-
public String sourceEmail;
68+
public String externalID;
69+
public String sourceEmail;
7070

71-
public FlashFundsPaymentCardData flashFundsPaymentCardData;
71+
public FlashFundsPaymentCardData flashFundsPaymentCardData;
7272

7373
public String gatewayTransactionId;
7474
public String cardBrandTransactionId;
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
package com.global.api.builders.requestbuilder.gpApi;
2+
3+
import com.global.api.builders.InstallmentBuilder;
4+
import com.global.api.entities.IRequestBuilder;
5+
import com.global.api.entities.exceptions.ApiException;
6+
import com.global.api.entities.gpApi.GpApiRequest;
7+
import com.global.api.gateways.GpApiConnector;
8+
import com.global.api.paymentMethods.Installment;
9+
import com.global.api.utils.JsonDoc;
10+
import com.global.api.utils.StringUtils;
11+
12+
public class GpApiInstallmentRequestBuilder implements IRequestBuilder<InstallmentBuilder> {
13+
14+
private static InstallmentBuilder _builder;
15+
16+
/**
17+
* Build request for installment
18+
* @param builder
19+
* @param gateway
20+
* @return GpApiRequest
21+
* @throws ApiException
22+
*/
23+
@Override
24+
public GpApiRequest buildRequest(InstallmentBuilder builder, GpApiConnector gateway) throws ApiException {
25+
_builder = builder;
26+
JsonDoc requestData = prepareInstallmentRequest(_builder, gateway);
27+
28+
return (GpApiRequest)
29+
new GpApiRequest()
30+
.setVerb(GpApiRequest.HttpMethod.Post)
31+
.setEndpoint(GpApiRequest.INSTALLMENT_ENDPOINT)
32+
.setRequestBody(requestData.toString());
33+
}
34+
35+
private static JsonDoc prepareInstallmentRequest(InstallmentBuilder builder, GpApiConnector gateway) {
36+
Installment installment = (Installment) builder.getEntity();
37+
JsonDoc requestData = new JsonDoc()
38+
.set("account_name", gateway.getGpApiConfig().getAccessTokenInfo().getTransactionProcessingAccountName())
39+
.set("amount", StringUtils.toNumeric(installment.getAmount()))
40+
.set("channel", gateway.getGpApiConfig().getChannel())
41+
.set("currency", installment.getCurrency())
42+
.set("country", gateway.getGpApiConfig().getCountry())
43+
.set("reference", installment.getReference())
44+
.set("program", installment.getProgram());
45+
46+
47+
JsonDoc cardData = new JsonDoc()
48+
.set("number", installment.getCreditCardData().getNumber())
49+
.set("expiry_month", installment.getCreditCardData().getExpMonth() != null ? StringUtils.padLeft(installment.getCreditCardData().getExpMonth(), 2, '0') : null)
50+
.set("expiry_year", installment.getCreditCardData().getExpYear() != null ? StringUtils.padLeft(installment.getCreditCardData().getExpYear(), 4, '0').substring(2, 4) : null);
51+
52+
JsonDoc paymentMethodData = new JsonDoc()
53+
.set("entry_mode", installment.getEntryMode())
54+
.set("card", cardData);
55+
requestData.set("payment_method", paymentMethodData);
56+
return requestData;
57+
}
58+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package com.global.api.entities;
2+
3+
import lombok.Getter;
4+
import lombok.Setter;
5+
6+
@Getter
7+
@Setter
8+
public class Action {
9+
10+
/**
11+
* Represents a unique identifier generated by Global Payments to identify an action.
12+
*/
13+
private String id;
14+
/**
15+
* Indicates the specific action taken.
16+
*/
17+
private String type;
18+
/**
19+
* Represents Global Payments time indicating when the object was created in ISO-8601 format.
20+
*/
21+
private String timeCreated;
22+
/**
23+
* Represents the result of the action executed.
24+
*/
25+
private String resultCode;
26+
/**
27+
* Represents id of the app that was used to create the token.
28+
*/
29+
private String appId;
30+
/**
31+
* Represents the name of the app the user gave to the application.
32+
*/
33+
private String appName;
34+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package com.global.api.entities;
2+
3+
import com.global.api.entities.exceptions.ApiException;
4+
import com.global.api.paymentMethods.Installment;
5+
6+
public interface IInstallmentEntity {
7+
Installment create(String configName) throws ApiException;
8+
}

0 commit comments

Comments
 (0)