com.google.checkout.merchantcalculation
Class MerchantCalculationCallback

java.lang.Object
  extended by com.google.checkout.merchantcalculation.CheckoutCallback
      extended by com.google.checkout.merchantcalculation.MerchantCalculationCallback

public class MerchantCalculationCallback
extends CheckoutCallback

This class encapsulates the <merchant-calculation-callback> callback.

Author:
simonjsmith@google.com

Field Summary
 
Fields inherited from class com.google.checkout.merchantcalculation.CheckoutCallback
document, root
 
Constructor Summary
MerchantCalculationCallback(org.w3c.dom.Document document)
           
MerchantCalculationCallback(java.io.InputStream inputStream)
          A constructor which takes the request as an InputStream.
MerchantCalculationCallback(java.lang.String requestString)
          A constructor which takes the request as a String.
 
Method Summary
 java.util.Collection getAnonymousAddresses()
          Returns a Collection of AnonymousAddress objects representing the <anonymous-address> tags in the request.
 long getBuyerId()
          Retrieves the value of the <buyer-id> element.
 java.lang.String getBuyerLanguage()
          Retrieves the value of the <buyer-language> element.
 java.util.Date getCartExpiration()
          Deprecated. Use getShoppingCart().getCartExpiration()
 java.util.Collection getItems()
          Deprecated. Use getShoppingCart().getItems()
 java.util.Collection getMerchantCodes()
          Returns a Collection of Strings representing the <merchant-code-strings>.
 org.w3c.dom.Element[] getMerchantPrivateDataNodes()
          Deprecated. Use getShoppingCart().getMerchantPrivateDataNodes()
 java.util.Collection getShippingMethods()
          Returns a Collection of Strings representing the <method> tags.
 ShoppingCart getShoppingCart()
          Retrieves the shopping cart
 boolean isCalculateTax()
          Indicates whether tax should be calculated or not.
 
Methods inherited from class com.google.checkout.merchantcalculation.CheckoutCallback
getSerialNumber, getType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MerchantCalculationCallback

public MerchantCalculationCallback(java.lang.String requestString)
                            throws CheckoutException
A constructor which takes the request as a String.

Parameters:
requestString - The xml string containing the callback data
Throws:
com.google.checkout.exceptions.CheckoutException
CheckoutException

MerchantCalculationCallback

public MerchantCalculationCallback(java.io.InputStream inputStream)
                            throws CheckoutException
A constructor which takes the request as an InputStream.

Parameters:
inputStream -
Throws:
com.google.checkout.exceptions.CheckoutException
CheckoutException

MerchantCalculationCallback

public MerchantCalculationCallback(org.w3c.dom.Document document)
Parameters:
document - An document containing callback information
Method Detail

getItems

public java.util.Collection getItems()
Deprecated. Use getShoppingCart().getItems()

Retrieves the contents of the <items> element as a Colection of Item objects.

Returns:
The Collection of Item objects.
See Also:
Item

getShoppingCart

public ShoppingCart getShoppingCart()
Retrieves the shopping cart

Returns:
A shopping cart containing buyer items

getMerchantPrivateDataNodes

public org.w3c.dom.Element[] getMerchantPrivateDataNodes()
Deprecated. Use getShoppingCart().getMerchantPrivateDataNodes()

Retrieves the contents of the <merchant-private-data> element as an array of Elements.

Returns:
The contents <merchant-private-data> element value.
See Also:
Element

getCartExpiration

public java.util.Date getCartExpiration()
                                 throws CheckoutException
Deprecated. Use getShoppingCart().getCartExpiration()

Retrieves the value of the <good-until-date> element.

Returns:
The cart expiration.
Throws:
com.google.checkout.exceptions.CheckoutException - if there was an error reading the cart expiration date
CheckoutException
See Also:
Date

getBuyerId

public long getBuyerId()
Retrieves the value of the <buyer-id> element.

Returns:
The buyer id.

getBuyerLanguage

public java.lang.String getBuyerLanguage()
Retrieves the value of the <buyer-language> element.

Returns:
The buyer language.

isCalculateTax

public boolean isCalculateTax()
Indicates whether tax should be calculated or not.

Returns:
The boolean tax indicator.

getShippingMethods

public java.util.Collection getShippingMethods()
Returns a Collection of Strings representing the <method> tags.

Returns:
A Collection of Strings.

getMerchantCodes

public java.util.Collection getMerchantCodes()
Returns a Collection of Strings representing the <merchant-code-strings>.

Returns:
A Collection of Strings.

getAnonymousAddresses

public java.util.Collection getAnonymousAddresses()
Returns a Collection of AnonymousAddress objects representing the <anonymous-address> tags in the request.

Returns:
A Collection of AnonymousAddress objects.
See Also:
AnonymousAddress