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

com.hps.integrator.entities.ebt.HpsEbtAuthorization 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.entities.ebt;

import com.hps.integrator.entities.debit.HpsDebitAuthorization;
import com.hps.integrator.infrastructure.Element;
import com.hps.integrator.infrastructure.ElementTree;

import java.math.BigDecimal;

public class HpsEbtAuthorization extends HpsDebitAuthorization {
    public HpsEbtAuthorization fromElementTree(ElementTree rsp) {
        Element saleResponse = rsp.get("Transaction").firstChild();

        super.fromElementTree(rsp);
        this.setAuthorizationCode(saleResponse.getString("AuthCode"));
        this.setAvsResultCode(saleResponse.getString("AVSRsltCode"));
        this.setAvsResultText(saleResponse.getString("AVSRsltText"));
        this.setCvvResultCode(saleResponse.getString("CVVRsltCode"));
        this.setCvvResultText(saleResponse.getString("CVVRsltText"));
        this.setCardType(saleResponse.getString("CardType"));
        if(saleResponse.has("AvailableBalance"))
            this.setAvailableBalance(new BigDecimal(saleResponse.getString("AvailableBalance")));
        if(saleResponse.has("AuthAmt"))
            this.setAuthorizedAmount(new BigDecimal(saleResponse.getString("AuthAmt")));

        return this;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy