com.google.checkout.notification
Class NewOrderNotification

java.lang.Object
  extended by com.google.checkout.notification.CheckoutNotification
      extended by com.google.checkout.notification.NewOrderNotification
All Implemented Interfaces:
java.io.Serializable

public class NewOrderNotification
extends CheckoutNotification

This class encapsulates the <new-order-notification> notification.

Author:
simonjsmith
See Also:
Serialized Form

Constructor Summary
NewOrderNotification(org.w3c.dom.Document document)
          A constructor which takes in an xml document representation of the request.
NewOrderNotification(java.io.InputStream inputStream)
          A constructor which takes the request as an InputStream.
NewOrderNotification(java.lang.String requestString)
          A constructor which takes the request as a String.
 
Method Summary
 float getAdjustmentTotal()
          Deprecated. Use getOrderAdjustment().getAdjustmentTotal();
 Address getBuyerBillingAddress()
          Retrieves the value of the <buyer-billing-address> element.
 long getBuyerId()
          Retrieves the value of the <buyer-id> element.
 BuyerMarketingPreferences getBuyerMarketingPreferences()
           
 Address getBuyerShippingAddress()
          Retrieves the value of the <buyer-shipping-address> element.
 java.util.Date getCartExpiration()
          Deprecated. Use getShoppingCart().getCartExpiration()
 FinancialOrderState getFinancialOrderState()
          Retrieves the value of the <financial-order-state> element.
 FulfillmentOrderState getFulfillmentOrderState()
          Retrieves the value of the <fulfillment-order-state> element.
 java.util.Collection getItems()
          Deprecated. Use getShoppingCart().getItems()
 java.util.Collection getMerchantCodes()
          Deprecated. Use getOrderAdjustment().getMerchantCodes()
 org.w3c.dom.Element[] getMerchantPrivateDataNodes()
          Deprecated. Use getShoppingCart().getMerchantPrivateDataNodes()
 OrderAdjustment getOrderAdjustment()
           
 java.lang.String getOrderCurrencyCode()
          Retrieves the currency code.
 float getOrderTotal()
          Retrieves the value of the <order-total> element.
 java.util.Collection getPromotions()
          Retrieves the promotions or null if no promotions are found
 Shipping getShipping()
          Deprecated. Use getOrderAdjustment().getShipping()
 ShoppingCart getShoppingCart()
          Retrieves the shopping cart
 float getTotalTax()
          Deprecated. Use getOrderAdjustment().getTotalTax();
 boolean isMarketingEmailAllowed()
          Deprecated. Use getBuyerMarketingPreferences().isMarketingEmailAllowed()
 boolean isMerchantCalculationSuccessful()
          Deprecated. Use getOrderAdjustment().isMerchantCalculationSuccessful()
 
Methods inherited from class com.google.checkout.notification.CheckoutNotification
getDocument, getGoogleOrderNo, getGoogleOrderNumber, getRoot, getRootNodeName, getSerialNumber, getTimestamp, getType, getXml, getXmlPretty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NewOrderNotification

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

Parameters:
requestString -
Throws:
CheckoutException - if there was an error prcessing the request string

NewOrderNotification

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

Parameters:
inputStream -
Throws:
CheckoutException - if there was an error prcessing the request from the InputStream

NewOrderNotification

public NewOrderNotification(org.w3c.dom.Document document)
A constructor which takes in an xml document representation of the request.

Parameters:
document -
Method Detail

getItems

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

Retrieves the contents of the <items> element as a Collection 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:
CheckoutException - if there was an error retrieving the cart expiration date
See Also:
Date

getBuyerShippingAddress

public Address getBuyerShippingAddress()
Retrieves the value of the <buyer-shipping-address> element.

Returns:
The buyer shipping address
See Also:
Address

getBuyerBillingAddress

public Address getBuyerBillingAddress()
Retrieves the value of the <buyer-billing-address> element.

Returns:
The buyer billing address
See Also:
Address

getBuyerMarketingPreferences

public BuyerMarketingPreferences getBuyerMarketingPreferences()

getOrderAdjustment

public OrderAdjustment getOrderAdjustment()

isMarketingEmailAllowed

public boolean isMarketingEmailAllowed()
Deprecated. Use getBuyerMarketingPreferences().isMarketingEmailAllowed()

Retrieves the value of the <email-allowed> element.

Returns:
The marketing preferences flag.

isMerchantCalculationSuccessful

public boolean isMerchantCalculationSuccessful()
Deprecated. Use getOrderAdjustment().isMerchantCalculationSuccessful()

Retrieves the value of the <merchant-calculation-successful> element.

Returns:
The merchant calculation successful flag.

getMerchantCodes

public java.util.Collection getMerchantCodes()
Deprecated. Use getOrderAdjustment().getMerchantCodes()

Retrieves the contents of the <merchant-codes> element as a collection of MerchantCodes objects.

Returns:
The merchant codes.
See Also:
MerchantCodes, GiftCertificateAdjustment, CouponAdjustment

getTotalTax

public float getTotalTax()
Deprecated. Use getOrderAdjustment().getTotalTax();

Retrieves the value of the <total-tax> element.

Returns:
The total tax.

getAdjustmentTotal

public float getAdjustmentTotal()
Deprecated. Use getOrderAdjustment().getAdjustmentTotal();

Retrieves the value of the <adjustment-total> element.

Returns:
The adjustment total amount.

getShipping

public Shipping getShipping()
Deprecated. Use getOrderAdjustment().getShipping()

Retrieves the value of the <shipping> element as a Shipping object.

Returns:
The shipping.
See Also:
Shipping

getOrderTotal

public float getOrderTotal()
Retrieves the value of the <order-total> element.

Returns:
The order total.

getOrderCurrencyCode

public java.lang.String getOrderCurrencyCode()
Retrieves the currency code.

Returns:
The currency code.

getPromotions

public java.util.Collection getPromotions()
Retrieves the promotions or null if no promotions are found

Returns:
The promotions associated with this NewOrderNotification or null if no promotions are found

getFulfillmentOrderState

public FulfillmentOrderState getFulfillmentOrderState()
Retrieves the value of the <fulfillment-order-state> element.

Returns:
The fulfillment order state or null if no state could be found.
See Also:
FulfillmentOrderState

getFinancialOrderState

public FinancialOrderState getFinancialOrderState()
Retrieves the value of the <financial-order-state> element.

Returns:
The financial order state or null if no state could be found.
See Also:
FinancialOrderState

getBuyerId

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

Returns:
The buyer id.