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

com.hps.integrator.terminals.pax.responses.GiftResponse Maven / Gradle / Ivy

Go to download

The SecureSubmit Java SDK simplifies processing of credit card transactions using Heartland Payment Systems' Portico Payment Gateway

There is a newer version: v2.5.2
Show newest version
package com.hps.integrator.terminals.pax.responses;

import com.hps.integrator.infrastructure.HpsMessageException;
import com.hps.integrator.infrastructure.emums.ControlCodes;
import com.hps.integrator.infrastructure.emums.PaxMsgId;
import com.hps.integrator.infrastructure.utils.MessageReader;
import com.hps.integrator.terminals.pax.subgroups.*;

import java.math.BigDecimal;

public class GiftResponse extends PaxDeviceResponse {
    private BigDecimal balanceAmount;

    public BigDecimal getBalanceAmount() {
        return balanceAmount;
    }

    public GiftResponse(byte[] buffer) throws HpsMessageException {
        super(buffer, PaxMsgId.T07_RSP_DO_GIFT, PaxMsgId.T09_RSP_DO_LOYALTY);
    }

    @Override
    protected void parseResponse(MessageReader br) throws HpsMessageException {
        super.parseResponse(br);

        if (deviceResponseCode.equals("000000")) {
            hostResponse = new HostResponse(br);
            transactionType = br.readToCode(ControlCodes.FS);
            amountResponse = new AmountResponse(br);
            accountResponse = new AccountResponse(br);
            traceResponse = new TraceResponse(br);
            extDataResponse = new ExtDataSubGroup(br);

            mapResponse();
        }
    }

    @Override
    protected void mapResponse() {
        super.mapResponse();

        if(amountResponse != null) {
            balanceAmount = amountResponse.getBalance1();
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy