anon.pay.xml
Class XMLPassivePayment

java.lang.Object
  extended by anon.pay.xml.XMLPassivePayment
All Implemented Interfaces:
IXMLEncodable

public class XMLPassivePayment
extends java.lang.Object
implements IXMLEncodable

This class is used by JAP to send information necessary to process a passive payment to the payment instance. 123456789 CreditCard 3 EUR Tobias Bayer VISA 0987654321 ...

Author:
Tobias Bayer, Elmar Schraml

Field Summary
private static java.lang.String AMOUNT
           
private static java.lang.String CHARGED
           
private static java.lang.String CURRENCY
           
private static java.lang.String ERRORCODE
           
private static java.lang.String ERRORMSG
           
private static java.lang.String IP
           
static java.lang.String KEY_ACCOUNTNUMBER
           
static java.lang.String KEY_COUPONCODE
           
static java.lang.String KEY_ERRORCODE
           
static java.lang.String KEY_ERRORMESSAGE
           
static java.lang.String KEY_IPADRESS
           
static java.lang.String KEY_MERCHANT_ID
           
static java.lang.String KEY_TRANSACTION_ID
           
static java.lang.String KEY_TRANSFERNUMBER
           
static java.lang.String KEY_VOLUMEPLAN
           
private  long m_centAmount
           
private  boolean m_charged
           
private  java.lang.String m_currency
           
private  java.util.Hashtable m_paymentData
           
private  java.lang.String m_paymentName
           
private  java.lang.String m_sErrorCode
           
private  java.lang.String m_sErrorMessage
           
private  java.lang.String m_sIP
           
private  long m_transferNumber
           
private static java.lang.String PAYMENT_DATA
           
private static java.lang.String PAYMENT_NAME
           
private static java.lang.String REF
           
private static java.lang.String TRANSFER_NUM
           
private static java.lang.String VERSION
           
private static java.lang.String XML_DOCUMENT_VERSION
           
static java.lang.String XML_ELEMENT_NAME
           
 
Fields inherited from interface anon.util.IXMLEncodable
FIELD_XML_ELEMENT_CONTAINER_NAME, FIELD_XML_ELEMENT_NAME, XML_ATTR_ID, XML_ATTR_LANGUAGE, XML_ATTR_VERSION
 
Constructor Summary
XMLPassivePayment()
          Constructor
XMLPassivePayment(byte[] xml)
          Constructor.
XMLPassivePayment(char[] xml)
           
XMLPassivePayment(org.w3c.dom.Document doc)
          Constructor.
XMLPassivePayment(org.w3c.dom.Element element)
          Constructor.
XMLPassivePayment(java.lang.String xml)
          Constructor.
 
Method Summary
 void addData(java.lang.String a_reference, java.lang.String a_data)
          Adds a element
 java.lang.String getAllPaymentData()
          Returns a string with all payment data fields.
 long getAmount()
          Gets the payment amount
 java.lang.String getCurrency()
          Gets the currency the user wants to pay in
 java.lang.String getErrorCode()
          Gets the payment method error code
 java.lang.String getErrorMessage()
          Gets the payment method error message
 java.lang.String getIP()
          Gets the payment method IP Adress
 java.lang.String getPaymentData(java.lang.String a_key)
          Gets the value of a line
 java.util.Enumeration getPaymentDataKeys()
           
 java.lang.String getPaymentName()
          Gets the payment method name
 java.util.Enumeration getReferences()
          Gets all references that belong to this message
 long getTransferNumber()
          Gets the transfer number that belongs to this message
 boolean isCharged()
           
 void setAmount(long a_amount)
          Sets the payment amount
 void setCharged(boolean charged)
           
 void setCurrency(java.lang.String a_currency)
          Sets the currency the user wants to pay in
 void setErrorCode(java.lang.String a_sErrorCode)
          Sets the payment method error code
 void setErrorMessage(java.lang.String a_sErrorMessage)
          Sets the payment method error message
 void setIP(java.lang.String a_sIP)
          Sets the payment method IP Adress
 void setPaymentName(java.lang.String a_paymentName)
          Sets the payment method name
 void setTransferNumber(long a_transferNumber)
          Sets the transfer number that belongs to this message
private  void setValues(org.w3c.dom.Element elemRoot)
          Sets the member values from an XML element.
 org.w3c.dom.Element toXmlElement(org.w3c.dom.Document a_doc)
          Produces an XML element from the member values
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XML_ELEMENT_NAME

public static final java.lang.String XML_ELEMENT_NAME
See Also:
Constant Field Values

XML_DOCUMENT_VERSION

private static final java.lang.String XML_DOCUMENT_VERSION
See Also:
Constant Field Values

VERSION

private static final java.lang.String VERSION
See Also:
Constant Field Values

TRANSFER_NUM

private static final java.lang.String TRANSFER_NUM
See Also:
Constant Field Values

AMOUNT

private static final java.lang.String AMOUNT
See Also:
Constant Field Values

CURRENCY

private static final java.lang.String CURRENCY
See Also:
Constant Field Values

CHARGED

private static final java.lang.String CHARGED
See Also:
Constant Field Values

PAYMENT_DATA

private static final java.lang.String PAYMENT_DATA
See Also:
Constant Field Values

REF

private static final java.lang.String REF
See Also:
Constant Field Values

PAYMENT_NAME

private static final java.lang.String PAYMENT_NAME
See Also:
Constant Field Values

ERRORCODE

private static final java.lang.String ERRORCODE
See Also:
Constant Field Values

ERRORMSG

private static final java.lang.String ERRORMSG
See Also:
Constant Field Values

IP

private static final java.lang.String IP
See Also:
Constant Field Values

m_paymentData

private java.util.Hashtable m_paymentData

m_transferNumber

private long m_transferNumber

m_currency

private java.lang.String m_currency

m_centAmount

private long m_centAmount

m_paymentName

private java.lang.String m_paymentName

m_charged

private boolean m_charged

m_sErrorCode

private java.lang.String m_sErrorCode

m_sErrorMessage

private java.lang.String m_sErrorMessage

m_sIP

private java.lang.String m_sIP

KEY_COUPONCODE

public static final java.lang.String KEY_COUPONCODE
See Also:
Constant Field Values

KEY_ACCOUNTNUMBER

public static final java.lang.String KEY_ACCOUNTNUMBER
See Also:
Constant Field Values

KEY_TRANSFERNUMBER

public static final java.lang.String KEY_TRANSFERNUMBER
See Also:
Constant Field Values

KEY_VOLUMEPLAN

public static final java.lang.String KEY_VOLUMEPLAN
See Also:
Constant Field Values

KEY_MERCHANT_ID

public static final java.lang.String KEY_MERCHANT_ID
See Also:
Constant Field Values

KEY_TRANSACTION_ID

public static final java.lang.String KEY_TRANSACTION_ID
See Also:
Constant Field Values

KEY_ERRORCODE

public static final java.lang.String KEY_ERRORCODE
See Also:
Constant Field Values

KEY_ERRORMESSAGE

public static final java.lang.String KEY_ERRORMESSAGE
See Also:
Constant Field Values

KEY_IPADRESS

public static final java.lang.String KEY_IPADRESS
See Also:
Constant Field Values
Constructor Detail

XMLPassivePayment

public XMLPassivePayment()
Constructor


XMLPassivePayment

public XMLPassivePayment(java.lang.String xml)
                  throws XMLParseException
Constructor. Creates object from an XML string.

Parameters:
xml - String
Throws:
java.lang.Exception
XMLParseException

XMLPassivePayment

public XMLPassivePayment(char[] xml)
                  throws XMLParseException
Throws:
XMLParseException

XMLPassivePayment

public XMLPassivePayment(byte[] xml)
                  throws XMLParseException
Constructor. Creates object from an XML bytearray .

Parameters:
xml - byte[]
Throws:
java.lang.Exception
XMLParseException

XMLPassivePayment

public XMLPassivePayment(org.w3c.dom.Document doc)
                  throws XMLParseException
Constructor. Creates object from an XML document.

Parameters:
doc - Document
Throws:
java.lang.Exception
XMLParseException

XMLPassivePayment

public XMLPassivePayment(org.w3c.dom.Element element)
                  throws XMLParseException
Constructor. Creates object from an XML element.

Parameters:
element - Element
Throws:
java.lang.Exception
XMLParseException
Method Detail

setValues

private void setValues(org.w3c.dom.Element elemRoot)
                throws XMLParseException
Sets the member values from an XML element.

Parameters:
elemRoot - Element
Throws:
java.lang.Exception
XMLParseException

setIP

public void setIP(java.lang.String a_sIP)
Sets the payment method IP Adress

Parameters:
a_sErrorCode - String

getIP

public java.lang.String getIP()
Gets the payment method IP Adress

Returns:
String

setErrorMessage

public void setErrorMessage(java.lang.String a_sErrorMessage)
Sets the payment method error message

Parameters:
a_sErrorCode - String

getErrorMessage

public java.lang.String getErrorMessage()
Gets the payment method error message

Returns:
String

setErrorCode

public void setErrorCode(java.lang.String a_sErrorCode)
Sets the payment method error code

Parameters:
a_sErrorCode - String

getErrorCode

public java.lang.String getErrorCode()
Gets the payment method error code

Returns:
String

setPaymentName

public void setPaymentName(java.lang.String a_paymentName)
Sets the payment method name

Parameters:
a_paymentName - String

getPaymentName

public java.lang.String getPaymentName()
Gets the payment method name

Returns:
String

setAmount

public void setAmount(long a_amount)
Sets the payment amount

Parameters:
a_amount - long: money amount in cents

setCurrency

public void setCurrency(java.lang.String a_currency)
Sets the currency the user wants to pay in

Parameters:
a_currency - String

setCharged

public void setCharged(boolean charged)

setTransferNumber

public void setTransferNumber(long a_transferNumber)
Sets the transfer number that belongs to this message

Parameters:
a_transferNumber - long

addData

public void addData(java.lang.String a_reference,
                    java.lang.String a_data)
Adds a element

Parameters:
a_reference - String The reference, of the input field
a_data - String The value teh user has entered in the input field

getAmount

public long getAmount()
Gets the payment amount

Returns:
double

getTransferNumber

public long getTransferNumber()
Gets the transfer number that belongs to this message

Returns:
long

getCurrency

public java.lang.String getCurrency()
Gets the currency the user wants to pay in

Returns:
String

isCharged

public boolean isCharged()

getReferences

public java.util.Enumeration getReferences()
Gets all references that belong to this message

Returns:
Enumeration

getPaymentData

public java.lang.String getPaymentData(java.lang.String a_key)
Gets the value of a line

Parameters:
a_key - String The reference of the input field that should be retrieved
Returns:
String, or null if key was not found

getAllPaymentData

public java.lang.String getAllPaymentData()
Returns a string with all payment data fields.

Returns:
String

getPaymentDataKeys

public java.util.Enumeration getPaymentDataKeys()

toXmlElement

public org.w3c.dom.Element toXmlElement(org.w3c.dom.Document a_doc)
Produces an XML element from the member values

Specified by:
toXmlElement in interface IXMLEncodable
Parameters:
a_doc - Document
Returns:
Element