All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.global.api.terminals.hpa.responses.BatchResponse Maven / Gradle / Ivy

There is a newer version: 14.2.3
Show newest version
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]
                [Number]
                [Number]
                [Card Type]
                [Transaction Type]
                [Card Acquisition]
                [Code]
                [Amount]
                [Amount]
                [Amount]
                [Amount]
                [Amount]
                
            */
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy