public class PaymentServerClient
extends java.lang.Object
Other communication options are created with subclasses of PaymentServerClient. A PaymentServerSSLClient communicates with Commerce Payments over an SSL connection.
In addition to the standard and SSL clients, CAL provides a test client. This test client is intended to support merchant programmers who need to develop merchant applications that will use payment types that do not yet exist. It is a subclass of PaymentServerClient and can be used throughout most of the merchant's program as a PaymentServerClient. However, when issueCommand is called against a test client, instead of sending the command to Commerce Payments the test client retrieves an XML document from a standard location and uses that as the response. These XML documents should reflect what would be returned by Commerce Payments if the new payment cassette actually existed.
The PaymentServerClient class exports a close method. merchant programs should call close prior to exiting. This is not particularly important for simple programs using standard TCP or SOCKS communication (the Java Runtime will clean up these resources on exit.). However, it is extremely important for SSL clients. Failure to call close on these clients can result in problems when the merchant's application is restarted. Since merchant programs can be converted to use SSL at any time, it would be good practice to ensure that close is called in all cases.
Modifier and Type | Field and Description |
---|---|
protected java.lang.String | dtdPath
Deprecated.
Communication
|
protected java.lang.String | hostName
Deprecated.
|
protected java.util.Hashtable | httpHeaderFields
Deprecated.
|
protected java.lang.String | lastRequest
Deprecated.
|
protected java.lang.String | lastXML
Deprecated.
|
protected java.net.Socket | socket
Deprecated.
|
protected java.lang.String | socksHostName
Deprecated.
|
protected int | socksPort
Deprecated.
|
protected int | tcpPort
Deprecated.
|
Constructor and Description |
---|
PaymentServerClient()
Deprecated.
Default constructor.
|
PaymentServerClient(java.lang.String dtdPath, java.lang.String hostName, int tcpPort)
Deprecated.
This constructor creates a Commerce Payments client.
|
PaymentServerClient(java.lang.String dtdPath, java.lang.String hostName, int tcpPort, java.util.Hashtable httpHeaderFields)
Deprecated.
This constructor creates a Commerce Payments client.
|
PaymentServerClient(java.lang.String dtdPath, java.lang.String hostName, int tcpPort, java.lang.String socksHostName, int socksPort)
Deprecated.
This constructor creates a Commerce Payments client.
|
PaymentServerClient(java.lang.String dtdPath, java.lang.String hostName, int tcpPort, java.lang.String socksHostName, int socksPort, java.util.Hashtable httpHeaderFields)
Deprecated.
This constructor creates a Commerce Payments client.
|
Modifier and Type | Method and Description |
---|---|
static void | addLocaleToHttpHeader(java.util.Hashtable httpHeaderPairs, java.util.Locale locale)
Deprecated.
Convert the locale to the form supported by the http protocol and add the accept language tage to the httpHeaderPairs.
|
void | close()
Deprecated.
Close (and finalize): Clean up the socket connection when this object goes out of scope using the finalize() method.
|
protected java.net.Socket | connect()
Deprecated.
Connect
|
protected void | finalize()
Deprecated.
|
java.lang.String | getHostname()
Deprecated.
Return the hostname of the Commerce Payments for which this instance was initialized.
|
java.util.Hashtable | getHTTPHeaderFields()
Deprecated.
Return the Hashtable of HTTP header fields with which this instance was initialized.
|
java.lang.String | getLastRequest()
Deprecated.
Return the last request.
|
java.lang.String | getLastXML()
Deprecated.
Return the last XML document.
|
int | getPort()
Deprecated.
Return the port number of the Commerce Payments for which this instance was initialized.
|
java.lang.String | getSocksHostname()
Deprecated.
Return the hostname of the socks server for which this instance was initialized.
|
int | getSocksPort()
Deprecated.
Return the port number of the socks server for which this instance was initialized.
|
void | init(java.lang.String dtdPath, java.lang.String hostName, int tcpPort)
Deprecated.
This method initializes the PaymentServerClient object.
|
void | init(java.lang.String dtdPath, java.lang.String hostName, int tcpPort, java.util.Hashtable httpHeaderFields)
Deprecated.
This method initializes the PaymentServerClient object.
|
void | init(java.lang.String dtdPath, java.lang.String hostName, int tcpPort, java.lang.String socksHostName, int socksPort)
Deprecated.
This method initializes the PaymentServerClient object.
|
void | init(java.lang.String dtdPath, java.lang.String hostName, int tcpPort, java.lang.String socksHostName, int socksPort, java.util.Hashtable httpHeaderFields)
Deprecated.
This method initializes the PaymentServerClient object.
|
PaymentServerResponse | issueCommand(java.lang.String command, java.util.Hashtable keywordValuePairs, byte[] pmAuthObject)
Deprecated.
Send commands to Commerce Payments.
|
PaymentServerResponse | issueCommand(java.lang.String command, java.util.Hashtable keywordValuePairs, java.util.Hashtable httpHeaderPairs, byte[] pmAuthObject)
Deprecated.
Send commands to Commerce Payments.
|
PaymentServerResponse | issueCommand(java.lang.String command, java.util.Hashtable keywordValuePairs, java.util.Hashtable httpHeaderPairs, java.lang.String basicAuthUserid, java.lang.String basicAuthPassword)
Deprecated.
Send commands to Commerce Payments.
|
PaymentServerResponse | issueCommand(java.lang.String command, java.util.Hashtable keywordValuePairs, java.lang.String basicAuthUserid, java.lang.String basicAuthPassword)
Deprecated.
Send commands to Commerce Payments.
|
protected java.lang.String dtdPath
protected java.lang.String hostName
protected int tcpPort
protected java.lang.String socksHostName
protected int socksPort
protected java.util.Hashtable httpHeaderFields
protected java.net.Socket socket
protected java.lang.String lastRequest
protected java.lang.String lastXML
public PaymentServerClient()
public PaymentServerClient(java.lang.String dtdPath, java.lang.String hostName, int tcpPort, java.lang.String socksHostName, int socksPort, java.util.Hashtable httpHeaderFields)
public PaymentServerClient(java.lang.String dtdPath, java.lang.String hostName, int tcpPort, java.lang.String socksHostName, int socksPort)
public PaymentServerClient(java.lang.String dtdPath, java.lang.String hostName, int tcpPort, java.util.Hashtable httpHeaderFields)
public PaymentServerClient(java.lang.String dtdPath, java.lang.String hostName, int tcpPort)
public java.lang.String getHostname()
public int getPort()
public java.lang.String getSocksHostname()
public int getSocksPort()
public java.util.Hashtable getHTTPHeaderFields()
public java.lang.String getLastRequest()
public java.lang.String getLastXML()
public void init(java.lang.String dtdPath, java.lang.String hostName, int tcpPort, java.lang.String socksHostName, int socksPort, java.util.Hashtable httpHeaderFields)
public void init(java.lang.String dtdPath, java.lang.String hostName, int tcpPort, java.lang.String socksHostName, int socksPort)
public void init(java.lang.String dtdPath, java.lang.String hostName, int tcpPort, java.util.Hashtable httpHeaderFields)
public void init(java.lang.String dtdPath, java.lang.String hostName, int tcpPort)
protected java.net.Socket connect() throws java.io.IOException
- create and connect a socket
- will be overridden by SSL client (and other subclasses)
public void close() throws java.io.IOException
protected void finalize() throws java.lang.Throwable
public PaymentServerResponse issueCommand(java.lang.String command, java.util.Hashtable keywordValuePairs, java.lang.String basicAuthUserid, java.lang.String basicAuthPassword) throws PaymentServerClientException, PaymentServerAuthorizationException, PaymentServerCommunicationException
public PaymentServerResponse issueCommand(java.lang.String command, java.util.Hashtable keywordValuePairs, byte[] pmAuthObject) throws PaymentServerClientException, PaymentServerAuthorizationException, PaymentServerCommunicationException
public PaymentServerResponse issueCommand(java.lang.String command, java.util.Hashtable keywordValuePairs, java.util.Hashtable httpHeaderPairs, java.lang.String basicAuthUserid, java.lang.String basicAuthPassword) throws PaymentServerClientException, PaymentServerAuthorizationException, PaymentServerCommunicationException
public PaymentServerResponse issueCommand(java.lang.String command, java.util.Hashtable keywordValuePairs, java.util.Hashtable httpHeaderPairs, byte[] pmAuthObject) throws PaymentServerClientException, PaymentServerAuthorizationException, PaymentServerCommunicationException
public static void addLocaleToHttpHeader(java.util.Hashtable httpHeaderPairs, java.util.Locale locale) throws PaymentServerClientException