com.google.checkout
Class CheckoutResponse

java.lang.Object
  extended by com.google.checkout.CheckoutResponse

public class CheckoutResponse
extends java.lang.Object

The default implementation of the CheckoutResponse interface.

Version:
1.0 - ksim - March 7th, 2007 - Initial Version to separate interface and implementation
Author:
ksim

Constructor Summary
CheckoutResponse()
           
CheckoutResponse(java.io.InputStream response)
          A constructor which takes the response as an InputStream.
CheckoutResponse(java.lang.String response)
          A constructor which takes the response String.
 
Method Summary
 java.lang.String getErrorMessage()
          If Google responded with an error (isGood = false) then this property will contain the human-readable error message.
 java.lang.String getRedirectUrl()
          If Google indicated a redirect URL in the response, this property will contain the URL string.
 java.lang.String getSerialNumber()
          Gets the serial number.
 java.lang.String getXml()
          Return the XML response String.
 java.lang.String getXmlPretty()
          Return the nicely formatted XML response String.
 boolean isValidRequest()
          Gets a value indicating whether Google returned an error code or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CheckoutResponse

public CheckoutResponse()
                 throws CheckoutException
Throws:
CheckoutException

CheckoutResponse

public CheckoutResponse(java.lang.String response)
                 throws CheckoutException
A constructor which takes the response String.

Parameters:
response - The response string
Throws:
CheckoutException

CheckoutResponse

public CheckoutResponse(java.io.InputStream response)
                 throws CheckoutException
A constructor which takes the response as an InputStream.

Parameters:
response - The response as an InputStream
Throws:
CheckoutException
Method Detail

isValidRequest

public boolean isValidRequest()
Gets a value indicating whether Google returned an error code or not. true if the response did not indicate an error; otherwise, false.

Returns:
The boolean value.

getSerialNumber

public java.lang.String getSerialNumber()
Gets the serial number. Google attaches a unique serial number to every response. The serial number, for example 58ea39d3-025b-4d52-a697-418f0be74bf9.

Returns:
The serial number.

getErrorMessage

public java.lang.String getErrorMessage()
If Google responded with an error (isGood = false) then this property will contain the human-readable error message. The error message returned by Google, or an empty string if there was no error.

Returns:
The error message.

getRedirectUrl

public java.lang.String getRedirectUrl()
If Google indicated a redirect URL in the response, this property will contain the URL string. The redirect URL, or the empty string if Google didn't send a redirect URL.

Returns:
The redirect URL.

getXml

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

Returns:
The XML response String.

getXmlPretty

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

Returns:
The nicely formatted XML response String.