com.global.api.gateways.bill_pay.GatewayRequestBase Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of globalpayments-sdk Show documentation
Show all versions of globalpayments-sdk Show documentation
API for processing payments through Global Payments
package com.global.api.gateways.bill_pay;
import com.global.api.entities.billing.Credentials;
import com.global.api.gateways.XmlGateway;
import com.global.api.utils.Element;
import com.global.api.utils.ElementTree;
public abstract class GatewayRequestBase extends XmlGateway {
protected Credentials credentials;
///
/// Creates a SOAP envelope with the necessary namespaces
///
/// The method name that is the target of the invocation
/// The Element that represents the envelope node
protected Element createSOAPEnvelope(ElementTree et, String soapAction)
{
setSOAPAction(soapAction);
addXMLNS(et);
return et.element("soapenv:Envelope");
}
///
/// Creates and sets the SOAPAction header using the supplied method name
///
/// The method name that is the target of the invocation
protected void setSOAPAction(String soapAction)
{
this.headers.put("SOAPAction", "https://test.heartlandpaymentservices.net/BillingDataManagement/v3/BillingDataManagementService/IBillingDataManagementService/" + soapAction);
}
///
/// Adds the XML Namespaces neccessary to make BillPay SOAP requests
///
/// The element tree for the SOAP request
protected void addXMLNS(ElementTree et)
{
et.addNamespace("soapenv", "http://schemas.xmlsoap.org/soap/envelope/");
et.addNamespace("bil", "https://test.heartlandpaymentservices.net/BillingDataManagement/v3/BillingDataManagementService");
et.addNamespace("bdms", "http://schemas.datacontract.org/2004/07/BDMS.NewModel");
et.addNamespace("hps", "http://schemas.datacontract.org/2004/07/HPS.BillerDirect.ACHCard.Wrapper");
et.addNamespace("pos", "http://schemas.datacontract.org/2004/07/POSGateway.Wrapper");
et.addNamespace("bdm", "https://test.heartlandpaymentservices.net/BillingDataManagement/v3/BDMServiceAdmin");
}
}