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

com.hps.integrator.entities.altpayment.HpsAltPaymentCreateSession 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.altpayment;

import com.hps.integrator.infrastructure.Element;
import com.hps.integrator.infrastructure.ElementTree;

import java.util.Dictionary;

public class HpsAltPaymentCreateSession extends HpsAltPaymentResponse {
    private String sessionId;
    private String redirectUrl;

    public String getSessionId() {
        return sessionId;
    }
    public void setSessionId(String sessionId) {
        this.sessionId = sessionId;
    }
    public String getRedirectUrl() {
        return redirectUrl;
    }
    public void setRedirectUrl(String redirectUrl) {
        this.redirectUrl = redirectUrl;
    }

    public HpsAltPaymentCreateSession fromElementTree(ElementTree rsp) {
        super.fromElementTree(rsp);

        Element session = rsp.get("Transaction").firstChild();
        if(session.has("Session")) {
            Dictionary pairs = nvpToArray(session.get("Session"));
            this.setSessionId(pairs.get("SessionId"));
            this.setRedirectUrl(pairs.get("RedirectUrl"));
        }

        return this;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy