com.google.checkout.merchantcalculation
Class MerchantCalculationResults

java.lang.Object
  extended by com.google.checkout.merchantcalculation.MerchantCalculationResults

public class MerchantCalculationResults
extends java.lang.Object

This class encapsulates the <merchant-calculation-callback> message which is part of the Merchant Calculation API.

Author:
simonjsmith

Constructor Summary
MerchantCalculationResults()
           
 
Method Summary
 void addResult(java.lang.String shippingName, java.lang.String addressId, boolean shippable, double totalTaxAmount, double shippingRate, java.lang.String currency, java.util.Collection merchantCodeResults)
          Add a result.
 void addResult(java.lang.String shippingName, java.lang.String addressId, boolean shippable, double shippingRate, java.lang.String currency, java.util.Collection merchantCodeResults)
          Add a result without including a total-tax amount.
protected  org.w3c.dom.Document getDocument()
          Returns the document representing the CheckoutShoppingCartRequest
 java.lang.String getXml()
          Return the XML String.
 java.lang.String getXmlPretty()
          Return the nicely formatted XML String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MerchantCalculationResults

public MerchantCalculationResults()
Method Detail

addResult

public void addResult(java.lang.String shippingName,
                      java.lang.String addressId,
                      boolean shippable,
                      double totalTaxAmount,
                      double shippingRate,
                      java.lang.String currency,
                      java.util.Collection merchantCodeResults)
Add a result.

Parameters:
shippingName - The shipping name.
addressId - The address id.
shippable - The shippable flag.
totalTaxAmount - The total tax amount.
shippingRate - The shipping rate.
currency - The currency code.
merchantCodeResults - A collection of MerchantCodeResult objects.
See Also:
MerchantCodeResult

addResult

public void addResult(java.lang.String shippingName,
                      java.lang.String addressId,
                      boolean shippable,
                      double shippingRate,
                      java.lang.String currency,
                      java.util.Collection merchantCodeResults)
Add a result without including a total-tax amount. It is important not to send back data which is not required.

Parameters:
shippingName - The shipping name.
addressId - The address id.
shippable - The shippable flag.
shippingRate - The shipping rate.
currency - The currency code.
merchantCodeResults - A collection of MerchantCodeResult objects.
See Also:
MerchantCodeResult

getDocument

protected org.w3c.dom.Document getDocument()
Returns the document representing the CheckoutShoppingCartRequest

Returns:
The document representing the CheckoutShoppingCartRequest

getXml

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

Returns:
The XML String.

getXmlPretty

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

Returns:
The nicely formatted XML String.