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

com.global.api.gateways.bill_pay.GatewayRequestBase Maven / Gradle / Ivy

There is a newer version: 14.2.3
Show newest version
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");
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy