com.google.checkout.checkout
Class CheckoutShoppingCartRequest

java.lang.Object
  extended by com.google.checkout.AbstractCheckoutRequest
      extended by com.google.checkout.checkout.CheckoutShoppingCartRequest

public class CheckoutShoppingCartRequest
extends AbstractCheckoutRequest

Class used to create the structure needed by Google Checkout The class also has the ability to send that request to Google or return the Xml needed to place in the hidden form fields.

Author:
simonjsmith@google.com

Field Summary
 
Fields inherited from class com.google.checkout.AbstractCheckoutRequest
merchantInfo
 
Constructor Summary
CheckoutShoppingCartRequest(MerchantInfo merchantInfo)
          Constructor which takes an instance of merchantInfo.
CheckoutShoppingCartRequest(MerchantInfo merchantInfo, int expirationMinutesFromNow)
          Constructor which takes an instance of merchantInfo and the cart expiration.
CheckoutShoppingCartRequest(MerchantInfo merchantInfo, java.lang.String cartXml)
          Constructor which takes an instance of merchatnInfo and a cart XML.
 
Method Summary
 void addAlternateTaxRule(java.lang.String tableName, boolean standalone, double taxRate, TaxArea taxArea)
          This method creates a new <alternate-tax-rule>.
 void addCarrierCalculatedShippingOption(float price, java.lang.String shippingCompany, CarrierPickup carrierPickup, java.lang.String shippingType, float additionalFixedCharge, float additionalVariableChargePercent)
          Add a <carrier-calculated-shipping> element.
 void addDefaultTaxRule(double taxRate, boolean shippingTaxed, TaxArea taxArea)
          This method creates a new <default-tax-rule>.
 void addFlatRateShippingMethod(java.lang.String name, float cost)
          This method adds a flat-rate shipping method to an order.
 void addFlatRateShippingMethod(java.lang.String name, float cost, ShippingRestrictions restrictions)
          This method adds a flat-rate shipping method to an order.
 void addItem(Item item)
          This method adds an item to an order.
 void addItem(java.lang.String name, java.lang.String description, float price, int quantity)
          This method adds an item to an order.
 void addItem(java.lang.String name, java.lang.String description, float price, int quantity, org.w3c.dom.Element[] merchantPrivateItemData)
          This method adds an item to an order.
 void addItem(java.lang.String name, java.lang.String description, float price, int quantity, java.lang.String merchantItemID)
          This method adds an item to an order.
 void addItem(java.lang.String name, java.lang.String description, float price, int quantity, java.lang.String merchantItemID, org.w3c.dom.Element[] merchantPrivateItemData, java.lang.String taxTableSelector)
          This method adds an item to an order.
 void addMerchantCalculatedShippingMethod(java.lang.String name, float defaultCost)
          This method adds a merchant-calculated shipping method to an order.
 void addMerchantCalculatedShippingMethod(java.lang.String name, float defaultCost, ShippingRestrictions restrictions)
          This method adds a merchant-calculated shipping method to an order.
 void addMerchantCalculatedShippingMethod(java.lang.String name, float defaultCost, ShippingRestrictions restrictions, AddressFilters filters)
          This method adds a merchant-calculated shipping method to an order.
 void addMerchantPrivateDataNode(org.w3c.dom.Element node)
          This method adds an Xml node to the <merchant-private-data> element.
 void addParameterizedUrl(java.lang.String url)
          Add a URL which has already been URL encoded to the <parameterized-urls> collection.
 void addParameterizedUrl(java.lang.String url, boolean urlEncode)
          Add a URL to the <parameterized-urls> collection.
 void addParameterizedUrl(java.lang.String url, boolean urlEncode, java.util.Collection parameters)
          Add a collection of URLs to the <parameterized-urls> collection.
 void addParameterizedUrl(java.lang.String url, java.util.Collection parameters)
          Add a collection of URLs which have already been URL encoded to the <parameterized-urls> collection.
 void addPickupShippingMethod(java.lang.String name, float cost)
          This method adds an instore-pickup shipping option to an order.
 void addShippingPackage(DeliveryAddressCategory deliveryAddressCategory, java.lang.String heightUnit, float heightValue, java.lang.String widthUnit, float widthValue, java.lang.String lengthUnit, float lengthValue, Packaging packaging, ShipFrom shipFrom)
          Add a <shipping-package> element.
 java.lang.String getAnalyticsData()
          Retrieves the value of the <analytics-data> element.
 java.util.Date getCartExpiration()
          Retrieves the value of the <good-until-date> element.
 java.lang.String getContinueShoppingUrl()
          Retrieves the value of the <continue-shopping-url> element.
 java.lang.String getEditCartUrl()
          Retrieves the value of the <edit-cart-url> element.
 java.lang.String getMerchantCalculationsUrl()
          Retrieves the value of the <merchant-calculations-url> element.
 org.w3c.dom.Element[] getMerchantPrivateDataNodes()
          Retrieves the contents of the <merchant-private-data> element as an array of Elements.
 long getPlatformID()
          Retrieves the value of the <platform-id> element.
 java.lang.String getPostUrl()
           
 boolean isAcceptMerchantCoupons()
          Retrieves the value that indicates whether the merchant accepts coupons.
 boolean isAcceptMerchantGiftCertificates()
          Retrieves the value that indicates whether the merchant accepts gift certificates.
 boolean isMerchantCalculatedTax()
          Retrieves the value that indicates whether the merchant is responsible for calculating taxes for the default tax table.
 boolean isRequestBuyerPhoneNumber()
          Retrieves the value of the <request-buyer-phone-number> element.
 boolean isRequestInitialAuthDetails()
          Retrieves the value of the <request-initial-auth-details> element.
 void setAcceptMerchantCoupons(boolean b)
          Sets the value that indicates whether the merchant accepts coupons.
 void setAcceptMerchantGiftCertificates(boolean b)
          Sets the value that indicates whether the merchant accepts gift certificates.
 void setAnalyticsData(java.lang.String data)
          Sets the value of the <analytics-data> element.
 void setCalculationMode(CalculationMode calcMode)
          Set the value of the <calculation-mode> element.
 void setCartExpiration(java.util.Date date)
          Sets the value of the <good-until-date> element.
 void setContinueShoppingUrl(java.lang.String url)
          Sets the value of the <continue-shopping-url> element.
 void setEditCartUrl(java.lang.String url)
          Sets the value of the <edit-cart-url> element.
 void setExpirationMinutesFromNow(int expirationMinutesFromNow)
          This method sets the value of the <good-until-date> using the value of the cartExpirationMinutes parameter.
 void setMerchantCalculatedTax(boolean b)
          Sets the value that indicates whether the merchant is responsible for calculating taxes for the default tax table.
 void setMerchantCalculationsUrl(java.lang.String url)
          Sets the value of the <merchant-calculations-url> element.
 void setMerchantPrivateDataNodes(org.w3c.dom.Element[] nodes)
          Sets the contents of the <merchant-private-data> element.
 void setPlatformID(long platformId)
          Sets the value of the <platform-id> element.
 void setRequestBuyerPhoneNumber(boolean b)
          Sets the value of the <request-buyer-phone-number> element.
 void setRequestInitialAuthDetails(boolean b)
          Sets the value of the <request-initial-auth-details> element.
 void setRoundingPolicy(RoundingRule rule, RoundingMode mode)
          Sets the value of the <rounding-policy> element and sub elements.
 
Methods inherited from class com.google.checkout.AbstractCheckoutRequest
getDocument, getRoot, getXml, getXmlPretty, send
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CheckoutShoppingCartRequest

public CheckoutShoppingCartRequest(MerchantInfo merchantInfo)
Constructor which takes an instance of merchantInfo.

Parameters:
merchantInfo - The merchant's information.

CheckoutShoppingCartRequest

public CheckoutShoppingCartRequest(MerchantInfo merchantInfo,
                                   java.lang.String cartXml)
                            throws CheckoutException
Constructor which takes an instance of merchatnInfo and a cart XML.

Parameters:
merchantInfo - The merchant's information.
cartXml - The xml string representation of the shopping cart.
Throws:
CheckoutException - If an xml document cannot be created from the cartXml

CheckoutShoppingCartRequest

public CheckoutShoppingCartRequest(MerchantInfo merchantInfo,
                                   int expirationMinutesFromNow)
Constructor which takes an instance of merchantInfo and the cart expiration.

Parameters:
merchantInfo - The merchant's information.
expirationMinutesFromNow - The number of minutes before the cart should expire.
Method Detail

addFlatRateShippingMethod

public void addFlatRateShippingMethod(java.lang.String name,
                                      float cost,
                                      ShippingRestrictions restrictions)
This method adds a flat-rate shipping method to an order. This method handles flat-rate shipping methods that have shipping restrictions.

Parameters:
name - The name of the shipping method. This value will be displayed on the Google Checkout order review page.
cost - The cost associated with the shipping method.
restrictions - A list of country, state or zip code areas where the shipping method is either available or unavailable.
See Also:
ShippingRestrictions

addItem

public void addItem(java.lang.String name,
                    java.lang.String description,
                    float price,
                    int quantity)
This method adds an item to an order. This method handles items that do not have <merchant-private-item-data> XML blocks associated with them.

Parameters:
name - The name of the item. This value corresponds to the value of the <item-name> tag in the Checkout API request.
description - The description of the item. This value corresponds to the value of the <item-description> tag in the Checkout API request.
price - The price of the item. This value corresponds to the value of the <unit-price> tag in the Checkout API request.
quantity - The number of this item that is included in the order. This value corresponds to the value of the <quantity> tag in the Checkout API request.

addItem

public void addItem(java.lang.String name,
                    java.lang.String description,
                    float price,
                    int quantity,
                    java.lang.String merchantItemID)
This method adds an item to an order. This method handles items that do not have <merchant-private-item-data> XML blocks associated with them.

Parameters:
name - The name of the item. This value corresponds to the value of the <item-name> tag in the Checkout API request.
description - The description of the item. This value corresponds to the value of the <item-description> tag in the Checkout API request.
price - The price of the item. This value corresponds to the value of the <unit-price> tag in the Checkout API request.
quantity - The number of this item that is included in the order. This value corresponds to the value of the <quantity> tag in the Checkout API request.
merchantItemID - The Merchant Item Id that uniquely identifies the product in your system. This value corresponds to the value of the <merchant-item-id> tag in the Checkout API request.

addItem

public void addItem(java.lang.String name,
                    java.lang.String description,
                    float price,
                    int quantity,
                    org.w3c.dom.Element[] merchantPrivateItemData)
This method adds an item to an order. This method handles items that have <merchant-private-item-data> XML blocks associated with them.

Parameters:
name - The name of the item. This value corresponds to the value of the <item-name> tag in the Checkout API request.
description - The description of the item. This value corresponds to the value of the <item-description> tag in the Checkout API request.
price - The price of the item. This value corresponds to the value of the <unit-price> tag in the Checkout API request.
quantity - The number of this item that is included in the order. This value corresponds to the value of the <quantity> tag in the Checkout API request.
merchantPrivateItemData - An array of XML nodes that should be associated with the item in the Checkout API request. This value corresponds to the value of the value of the <merchant-private-item-data> tag in the Checkout API request.

addItem

public void addItem(java.lang.String name,
                    java.lang.String description,
                    float price,
                    int quantity,
                    java.lang.String merchantItemID,
                    org.w3c.dom.Element[] merchantPrivateItemData,
                    java.lang.String taxTableSelector)
This method adds an item to an order. This method handles items that have <merchant-private-item-data> XML blocks associated with them.

Parameters:
name - The name of the item. This value corresponds to the value of the <item-name> tag in the Checkout API request.
description - The description of the item. This value corresponds to the value of the <item-description> tag in the Checkout API request.
price - The price of the item. This value corresponds to the value of the <unit-price> tag in the Checkout API request.
quantity - The number of this item that is included in the order. This value corresponds to the value of the <quantity> tag in the Checkout API request.
merchantItemID - The Merchant Item Id that uniquely identifies the product in your system. This value corresponds to the value of the <merchant-item-id> tag in the Checkout API request.
merchantPrivateItemData - An array of XML nodes that should be associated with the item in the Checkout API request. This value corresponds to the value of the value of the <merchant-private-item-data> tag in the Checkout API request.
taxTableSelector - The name of the alternate tax table that should be used to calculate tax for the item. This value corresponds to the value of the value of the <tax-table-selector> tag in the Checkout API request.

addItem

public void addItem(Item item)
This method adds an item to an order. This method handles items that have <merchant-private-item-data> XML blocks associated with them.

Parameters:
item - The Item object.
See Also:
Item

addMerchantCalculatedShippingMethod

public void addMerchantCalculatedShippingMethod(java.lang.String name,
                                                float defaultCost)
This method adds a merchant-calculated shipping method to an order. This method handles merchant-calculated shipping methods that do not have shipping restrictions.

Parameters:
name - The name of the shipping method. This value will be displayed on the Google Checkout order review page.
defaultCost - The default cost associated with the shipping method. This value is the amount that Gogle Checkout will charge for shipping if the merchant calculation callback request fails.

addMerchantCalculatedShippingMethod

public void addMerchantCalculatedShippingMethod(java.lang.String name,
                                                float defaultCost,
                                                ShippingRestrictions restrictions)
This method adds a merchant-calculated shipping method to an order. This method handles merchant-calculated shipping methods that have shipping restrictions.

Parameters:
name - The name of the shipping method. This value will be displayed on the Google Checkout order review page.
defaultCost - The default cost associated with the shipping method. This value is the amount that Gogle Checkout will charge for shipping if the merchant calculation callback request fails.
restrictions - A list of country, state or zip code areas where the shipping method is either available or unavailable.
See Also:
ShippingRestrictions

addMerchantCalculatedShippingMethod

public void addMerchantCalculatedShippingMethod(java.lang.String name,
                                                float defaultCost,
                                                ShippingRestrictions restrictions,
                                                AddressFilters filters)
This method adds a merchant-calculated shipping method to an order. This method handles merchant-calculated shipping methods that have shipping restrictions.

Parameters:
name - The name of the shipping method. This value will be displayed on the Google Checkout order review page.
defaultCost - The default cost associated with the shipping method. This value is the amount that Gogle Checkout will charge for shipping if the merchant calculation callback request fails.
restrictions - A list of country, state or zip code areas where the shipping method is either available or unavailable.
filters - Similar to the shipping restrictions, filters will be applied before Google Checkout sends a to the merchant.
See Also:
ShippingRestrictions

addPickupShippingMethod

public void addPickupShippingMethod(java.lang.String name,
                                    float cost)
This method adds an instore-pickup shipping option to an order.

Parameters:
name - The name of the shipping method. This value will be displayed on the Google Checkout order review page.
cost - The cost associated with the shipping method.

getAnalyticsData

public java.lang.String getAnalyticsData()
Retrieves the value of the <analytics-data> element. Google Analytics uses this to Track Google Checkout Orders. Please read http://code.google.com/apis/checkout/developer/checkout_analytics_integration.html" for more information.

Returns:
The <analytics-data> element value.

getCartExpiration

public java.util.Date getCartExpiration()
                                 throws CheckoutException
Retrieves the value of the <good-until-date> element.

Returns:
The cart expiration.
Throws:
CheckoutException
See Also:
Date

getContinueShoppingUrl

public java.lang.String getContinueShoppingUrl()
Retrieves the value of the <continue-shopping-url> element. Google Checkout will display a link to this URL on the page that the customer sees after completing her purchase.

Returns:
The <continue-shopping-url> element value.

getEditCartUrl

public java.lang.String getEditCartUrl()
Retrieves the value of the <edit-cart-url> element. Google Checkout will display a link to this URL on the Google Checkout order confirmation page. The customer can click this link to edit the shopping cart contents before completing a purchase.

Returns:
The <edit-cart-url> element value.

getMerchantCalculationsUrl

public java.lang.String getMerchantCalculationsUrl()
Retrieves the value of the <merchant-calculations-url> element. This value is the URL to which Google Checkout will send <merchant-calculation-callback> requests. This property is only relevant for merchants who are implementing the Merchant Calculations API.

Returns:
The <merchant-calculations-url> element value.

getPlatformID

public long getPlatformID()
Retrieves the value of the <platform-id> element. The <platform-id> tag should only be used by eCommerce providers who make API requests on behalf of a merchant. The tag's value contains a Google Checkout merchant ID that identifies the eCommerce provider.

Returns:
The <analytics-data> element value.

isAcceptMerchantCoupons

public boolean isAcceptMerchantCoupons()
Retrieves the value that indicates whether the merchant accepts coupons. If this value is set to true, the Google Checkout order confirmation page will display a text field where the customer can enter a coupon code. This value of this property is a Boolean value that indicates whether the merchant accepts coupons. This value should only be set to true if the merchant has implemented the Merchant Calculations API.

Returns:
The boolean value.

isAcceptMerchantGiftCertificates

public boolean isAcceptMerchantGiftCertificates()
Retrieves the value that indicates whether the merchant accepts gift certificates. If this value is set to true, the Google Checkout order confirmation page will display a text field where the customer can enter a gift certificate code. This value of this property is a Boolean value that indicates whether the merchant accepts gift certificates. This value should only be set to true if the merchant has implemented the Merchant Calculations API.

Returns:
The boolean value.

isMerchantCalculatedTax

public boolean isMerchantCalculatedTax()
Retrieves the value that indicates whether the merchant is responsible for calculating taxes for the default tax table.

Returns:
The value of this property should be true if the merchant will calculate taxes for the order. Otherwise, this value should be false. The value should only be true if the merchant has implemented the Merchant Calculations API.

isRequestBuyerPhoneNumber

public boolean isRequestBuyerPhoneNumber()
Retrieves the value of the <request-buyer-phone-number> element. If this value is true, the buyer must enter a phone number to complete a purchase.

Returns:
true if the Google should send the buyer's phone number to the merchant, otherwise false.

setAcceptMerchantCoupons

public void setAcceptMerchantCoupons(boolean b)
Sets the value that indicates whether the merchant accepts coupons. If this value is set to true, the Google Checkout order confirmation page will display a text field where the customer can enter a coupon code. This value of this property is a Boolean value that indicates whether the merchant accepts coupons. This value should only be set to true if the merchant has implemented the Merchant Calculations API.

Parameters:
b - The boolean value.

setAcceptMerchantGiftCertificates

public void setAcceptMerchantGiftCertificates(boolean b)
Sets the value that indicates whether the merchant accepts gift certificates. If this value is set to true, the Google Checkout order confirmation page will display a text field where the customer can enter a gift certificate code. This value of this property is a Boolean value that indicates whether the merchant accepts gift certificates. This value should only be set to true if the merchant has implemented the Merchant Calculations API.

Parameters:
b - The boolean value.

setCalculationMode

public void setCalculationMode(CalculationMode calcMode)
Set the value of the <calculation-mode> element. The value of this element determines whether Google will send the addresses one at a time or in batch to your merchant calculations handler.

Parameters:
calcMode - The CalculationMode.
See Also:
CalculationMode

setAnalyticsData

public void setAnalyticsData(java.lang.String data)
Sets the value of the <analytics-data> element. Google Analytics uses this to Track Google Checkout Orders. Please read http://code.google.com/apis/checkout/developer/checkout_analytics_integration.html" for more information.

Parameters:
data - The <analytics-data> element value.

setCartExpiration

public void setCartExpiration(java.util.Date date)
Sets the value of the <good-until-date> element.

Parameters:
date - The cart expiration.
See Also:
Date

setContinueShoppingUrl

public void setContinueShoppingUrl(java.lang.String url)
Sets the value of the <continue-shopping-url> element. Google Checkout will display a link to this URL on the page that the customer sees after completing her purchase.

Parameters:
url - The <continue-shopping-url> element value.

setEditCartUrl

public void setEditCartUrl(java.lang.String url)
Sets the value of the <edit-cart-url> element. Google Checkout will display a link to this URL on the Google Checkout order confirmation page. The customer can click this link to edit the shopping cart contents before completing a purchase.

Parameters:
url - The <edit-cart-url> element value.

setExpirationMinutesFromNow

public void setExpirationMinutesFromNow(int expirationMinutesFromNow)
This method sets the value of the <good-until-date> using the value of the cartExpirationMinutes parameter. This method converts that value into Coordinated Universal Time (UTC).

Parameters:
expirationMinutesFromNow - The length of time, in minutes, after which the shopping cart should expire.

setMerchantCalculatedTax

public void setMerchantCalculatedTax(boolean b)
Sets the value that indicates whether the merchant is responsible for calculating taxes for the default tax table.

Parameters:
b - The value of this property should be true if the merchant will calculate taxes for the order. Otherwise, this value should be false. The value should only be true if the merchant has implemented the Merchant Calculations API.

setMerchantCalculationsUrl

public void setMerchantCalculationsUrl(java.lang.String url)
Sets the value of the <merchant-calculations-url> element. This value is the URL to which Google Checkout will send <merchant-calculation-callback> requests. This property is only relevant for merchants who are implementing the Merchant Calculations API.

Parameters:
url - The <merchant-calculations-url> element value.

setPlatformID

public void setPlatformID(long platformId)
Sets the value of the <platform-id> element. The <platform-id> tag should only be used by eCommerce providers who make API requests on behalf of a merchant. The tag's value contains a Google Checkout merchant ID that identifies the eCommerce provider.

Parameters:
platformId - The <analytics-data> element value.

setRequestBuyerPhoneNumber

public void setRequestBuyerPhoneNumber(boolean b)
Sets the value of the <request-buyer-phone-number> element. If this value is true, the buyer must enter a phone number to complete a purchase.

Parameters:
b - true if the Google should send the buyer's phone number to the merchant, otherwise false.

getMerchantPrivateDataNodes

public org.w3c.dom.Element[] 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

setMerchantPrivateDataNodes

public void setMerchantPrivateDataNodes(org.w3c.dom.Element[] nodes)
Sets the contents of the <merchant-private-data> element.

Parameters:
nodes - The <merchant-private-data> element value.
See Also:
Element

addAlternateTaxRule

public void addAlternateTaxRule(java.lang.String tableName,
                                boolean standalone,
                                double taxRate,
                                TaxArea taxArea)
This method creates a new <alternate-tax-rule>.

Parameters:
tableName - The name for the tax table.
standalone - The standalone attribute indicates how taxes should be calculated if there is no matching alternate-tax-rule for the given state, zip code or country area. If this attribute's value is TRUE and there is no matching alternate-tax-rule, the tax amount will be zero. If the attribute's value is FALSE and there is no matching alternate-tax-rule, the tax amount will be calculated using the default tax table.
taxRate - The tax rate to be applied.
taxArea - The TaxArea for which this rule applies.
See Also:
TaxArea

addDefaultTaxRule

public void addDefaultTaxRule(double taxRate,
                              boolean shippingTaxed,
                              TaxArea taxArea)
This method creates a new <default-tax-rule>.

Parameters:
taxRate - The tax rate to be applied.
shippingTaxed - Whether the shipping is taxed or not.
taxArea - The TaxArea for which this rule applies.
See Also:
TaxArea

addParameterizedUrl

public void addParameterizedUrl(java.lang.String url)
                         throws java.io.UnsupportedEncodingException
Add a URL which has already been URL encoded to the <parameterized-urls> collection. These tags are used to support third party conversion tracking.

Parameters:
url - The UrlEncoded <parameterized-url> to add to the collection.
Throws:
java.io.UnsupportedEncodingException

addParameterizedUrl

public void addParameterizedUrl(java.lang.String url,
                                boolean urlEncode)
                         throws java.io.UnsupportedEncodingException
Add a URL to the <parameterized-urls> collection. These tags are used to support third party conversion tracking.

Parameters:
url - The UrlEncoded <parameterized-url> to add to the collection.
urlEncode - Set to true if you need the url to be URL encoded.
Throws:
java.io.UnsupportedEncodingException

addParameterizedUrl

public void addParameterizedUrl(java.lang.String url,
                                java.util.Collection parameters)
                         throws java.io.UnsupportedEncodingException
Add a collection of URLs which have already been URL encoded to the <parameterized-urls> collection. These tags are used to support third party conversion tracking.

Parameters:
url - The UrlEncoded <parameterized-url> to add to the collection.
parameters - A collection of UrlParameter objects which define the parameters to be added to the URL.
Throws:
java.io.UnsupportedEncodingException
See Also:
UrlParameter

addParameterizedUrl

public void addParameterizedUrl(java.lang.String url,
                                boolean urlEncode,
                                java.util.Collection parameters)
                         throws java.io.UnsupportedEncodingException
Add a collection of URLs to the <parameterized-urls> collection. These tags are used to support third party conversion tracking.

Parameters:
url - The UrlEncoded <parameterized-url> to add to the collection.
urlEncode - Set to true if you need the url to be URL encoded.
parameters - A collection of UrlParameter objects which define the parameters to be added to the URL.
Throws:
java.io.UnsupportedEncodingException
See Also:
UrlParameter

getPostUrl

public java.lang.String getPostUrl()
Overrides:
getPostUrl in class AbstractCheckoutRequest

addFlatRateShippingMethod

public void addFlatRateShippingMethod(java.lang.String name,
                                      float cost)
This method adds a flat-rate shipping method to an order. This method handles flat-rate shipping methods that do not have shipping restrictions.

Parameters:
name - The name of the shipping method. This value will be displayed on the Google Checkout order review page.
cost - The cost associated with the shipping method.

addMerchantPrivateDataNode

public void addMerchantPrivateDataNode(org.w3c.dom.Element node)
This method adds an Xml node to the <merchant-private-data> element.

Parameters:
node - The <merchant-private-data> element.

isRequestInitialAuthDetails

public boolean isRequestInitialAuthDetails()
Retrieves the value of the <request-initial-auth-details> element. The <request-initial-auth-details> tag indicates whether Google should send an <authorization-amount-notification> when a credit card is authorized for a new order.

Returns:
The <request-initial-auth-details> element value.

setRequestInitialAuthDetails

public void setRequestInitialAuthDetails(boolean b)
Sets the value of the <request-initial-auth-details> element. The <request-initial-auth-details> tag indicates whether Google should send an <authorization-amount-notification> when a credit card is authorized for a new order.

Parameters:
b - The boolean value.

setRoundingPolicy

public void setRoundingPolicy(RoundingRule rule,
                              RoundingMode mode)
Sets the value of the <rounding-policy> element and sub elements.

Parameters:
rule - The RoundingRule.
mode - The RoundingMode.
See Also:
RoundingRule, RoundingMode

addCarrierCalculatedShippingOption

public void addCarrierCalculatedShippingOption(float price,
                                               java.lang.String shippingCompany,
                                               CarrierPickup carrierPickup,
                                               java.lang.String shippingType,
                                               float additionalFixedCharge,
                                               float additionalVariableChargePercent)
Add a <carrier-calculated-shipping> element. See the carrier calculated shipping docs for more information on this feature.

Parameters:
price - The default price.
shippingCompany - The shipping company, see docs for supported companies.
carrierPickup - The carrier pickup type.
shippingType - The shipping type, see docs for supported types.
additionalFixedCharge - An additional fixed charge.
additionalVariableChargePercent - A variable charge percent.
See Also:
CarrierPickup

addShippingPackage

public void addShippingPackage(DeliveryAddressCategory deliveryAddressCategory,
                               java.lang.String heightUnit,
                               float heightValue,
                               java.lang.String widthUnit,
                               float widthValue,
                               java.lang.String lengthUnit,
                               float lengthValue,
                               Packaging packaging,
                               ShipFrom shipFrom)
Add a <shipping-package> element. See the carrier calculated shipping docs for more information on this feature.

Parameters:
deliveryAddressCategory - The delivery address category.
heightUnit - The height unit.
heightValue - The height value.
widthUnit - The width unit.
widthValue - The width value.
lengthUnit - The length unit.
lengthValue - The length value.
packaging - The packaging.
shipFrom - The ship from details.
See Also:
DeliveryAddressCategory, Packaging, ShipFrom