com.google.checkout
Class AbstractCheckoutRequest

java.lang.Object
  extended by com.google.checkout.AbstractCheckoutRequest
Direct Known Subclasses:
AbstractOrderProcessingRequest, CheckoutShoppingCartRequest

public abstract class AbstractCheckoutRequest
extends java.lang.Object

The parent for all Checkout requests.

Author:
simonjsmith@google.com

Field Summary
protected  MerchantInfo merchantInfo
           
 
Constructor Summary
AbstractCheckoutRequest(MerchantInfo merchantInfo, org.w3c.dom.Document document)
           
AbstractCheckoutRequest(MerchantInfo merchantInfo, java.lang.String requestType)
           
 
Method Summary
protected  org.w3c.dom.Document getDocument()
           
 java.lang.String getPostUrl()
           
protected  org.w3c.dom.Element getRoot()
           
 java.lang.String getXml()
          Return the XML request String.
 java.lang.String getXmlPretty()
          Return the nicely formatted XML request String.
 CheckoutResponse send()
          Submit the request to the POST URL and return a CheckoutResponse.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

merchantInfo

protected MerchantInfo merchantInfo
Constructor Detail

AbstractCheckoutRequest

public AbstractCheckoutRequest(MerchantInfo merchantInfo,
                               java.lang.String requestType)
Parameters:
merchantInfo - The merchant's information
requestType - The request type
Throws:
java.lang.IllegalArgumentException - if the MerchantInfo is null.

AbstractCheckoutRequest

public AbstractCheckoutRequest(MerchantInfo merchantInfo,
                               org.w3c.dom.Document document)
Parameters:
merchantInfo - The merchant's info
document - A document that has already been constructed
Method Detail

getDocument

protected org.w3c.dom.Document getDocument()
Returns:
The document for this CheckoutRequest

getRoot

protected org.w3c.dom.Element getRoot()
Returns:
The root of the document for this CheckoutRequest

getPostUrl

public java.lang.String getPostUrl()

getXml

public java.lang.String getXml()
Return the XML request String.

Returns:
The XML request String.

getXmlPretty

public java.lang.String getXmlPretty()
Return the nicely formatted XML request String.

Returns:
The nicely formatted XML request String.

send

public CheckoutResponse send()
                      throws CheckoutException
Submit the request to the POST URL and return a CheckoutResponse.

Returns:
The CheckoutResponse object.
Throws:
CheckoutException - if the post URL for the merchant info was invalid.
See Also:
CheckoutResponse