com.global.api.terminals.hpa.responses.BatchResponse Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of globalpayments-sdk Show documentation
Show all versions of globalpayments-sdk Show documentation
API for processing payments through Global Payments
package com.global.api.terminals.hpa.responses;
import com.global.api.entities.exceptions.ApiException;
import com.global.api.terminals.abstractions.IBatchCloseResponse;
import com.global.api.utils.Element;
@Deprecated
public class BatchResponse extends SipBaseResponse implements IBatchCloseResponse {
private String totalCount;
private String totalAmount;
private String sequenceNumber;
public String getTotalCount() {
return totalCount;
}
public void setTotalCount(String totalCount) {
this.totalCount = totalCount;
}
public String getTotalAmount() {
return totalAmount;
}
public void setTotalAmount(String totalAmount) {
this.totalAmount = totalAmount;
}
public String getSequenceNumber() {
return sequenceNumber;
}
public void setSequenceNumber(String sequenceNumber) {
this.sequenceNumber = sequenceNumber;
}
public BatchResponse(byte[] buffer, String... messageIds) throws ApiException {
super(buffer, messageIds);
}
protected void mapResponse(Element response) {
super.mapResponse(response);
if(response.has("BatchSeqNbr")) {
responseCode = response.getString("ResponseCode", "Result");
responseText = response.getString("ResponseText", "ResultText");
sequenceNumber = response.getString("BatchSeqNbr");
totalAmount = response.getString("BatchTxnAmt");
totalCount = response.getString("BatchTxnCnt");
}
Element[] cardRecords = response.getAll("CardSummaryRecord");
for(Element record: cardRecords) {}
Element[] transactionRecords = response.getAll("TransactionSummaryReport");
for(Element record: transactionRecords) {}
Element details = response.get("BatchDetailRecord");
//details.GetValue("ReferenceNumber");
//details.GetValue("TransactionTime");
//details.GetValue("MaskedPAN");
//details.GetValue("CardType");
//details.GetValue("TransactionType");
//details.GetValue("CardAcquisition");
//details.GetValue("ApprovalCode");
//details.GetValue("BalanceReturned");
//details.GetValue("BaseAmount");
//details.GetValue("CashbackAmount");
//details.GetValue("TaxAmount");
//details.GetValue("TipAmount");
//details.GetValue("DonationAmount");
//details.GetValue("TotalAmount");
// TODO: Store and Forward
/*
[Number]
[Amount]
[Number]
[Amount]
[Number]
[Amount]
*/
Element[] safRecords = response.getAll("ApprovedSAFRecord");
for(Element record: safRecords) {
/*
[Number] ReferenceNumber>
[Number] TransactionTime>
[Number] MaskedPAN>
[Card Type]
[Transaction Type]
[Card Acquisition]
[Code]
[Amount]
[Amount]
[Amount]
[Amount]
[Amount]
*/
}
}
}