![JAR search and dependency download from the Maven repository](/logo.png)
com.hps.integrator.entities.altpayment.HpsAltPaymentResponse Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of secure-submit Show documentation
Show all versions of secure-submit Show documentation
The SecureSubmit Java SDK simplifies processing of credit card transactions using Heartland Payment Systems' Portico Payment Gateway
package com.hps.integrator.entities.altpayment;
import com.hps.integrator.entities.credit.HpsAuthorization;
import com.hps.integrator.infrastructure.Element;
import com.hps.integrator.infrastructure.ElementTree;
import com.hps.integrator.infrastructure.HpsProcessorError;
import java.util.Dictionary;
import java.util.Hashtable;
public class HpsAltPaymentResponse extends HpsAuthorization {
HpsProcessorError error;
public HpsAltPaymentResponse fromElementTree(ElementTree rsp) {
super.fromElementTree(rsp);
Element response = rsp.get("Transaction").firstChild();
if(response.getInt("RspCode") != 0){
Dictionary error = nvpToArray(response.get("Processor").get("Response"));
this.error = new HpsProcessorError();
this.error.setCode(error.get("Code") != null ? error.get("Code") : null);
this.error.setMessage(error.get("Message") != null ? error.get("Message") : null);
this.error.setType(error.get("Type") != null ? error.get("Type") : null);
}
return this;
}
protected Dictionary nvpToArray(Element pairs) {
Dictionary rvalue = new Hashtable();
for(Element pair: pairs.getAll())
rvalue.put(pair.getString("Name"), pair.getString("Value"));
return rvalue;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy