|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.checkout.AbstractCheckoutRequest
com.google.checkout.checkout.CheckoutShoppingCartRequest
public class CheckoutShoppingCartRequest
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.
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 |
---|
public CheckoutShoppingCartRequest(MerchantInfo merchantInfo)
merchantInfo
- The merchant's information.public CheckoutShoppingCartRequest(MerchantInfo merchantInfo, java.lang.String cartXml) throws CheckoutException
merchantInfo
- The merchant's information.cartXml
- The xml string representation of the shopping cart.
CheckoutException
- If an xml document cannot be created from the
cartXmlpublic CheckoutShoppingCartRequest(MerchantInfo merchantInfo, int expirationMinutesFromNow)
merchantInfo
- The merchant's information.expirationMinutesFromNow
- The number of minutes before the cart
should expire.Method Detail |
---|
public void addFlatRateShippingMethod(java.lang.String name, float cost, ShippingRestrictions restrictions)
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.ShippingRestrictions
public void addItem(java.lang.String name, java.lang.String description, float price, int quantity)
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.public void addItem(java.lang.String name, java.lang.String description, float price, int quantity, java.lang.String merchantItemID)
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.public void addItem(java.lang.String name, java.lang.String description, float price, int quantity, org.w3c.dom.Element[] merchantPrivateItemData)
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.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)
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.public void addItem(Item item)
item
- The Item object.Item
public void addMerchantCalculatedShippingMethod(java.lang.String name, float defaultCost)
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.public void addMerchantCalculatedShippingMethod(java.lang.String name, float defaultCost, ShippingRestrictions restrictions)
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.ShippingRestrictions
public void addMerchantCalculatedShippingMethod(java.lang.String name, float defaultCost, ShippingRestrictions restrictions, AddressFilters filters)
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
ShippingRestrictions
public void addPickupShippingMethod(java.lang.String name, float cost)
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.public java.lang.String getAnalyticsData()
public java.util.Date getCartExpiration() throws CheckoutException
CheckoutException
Date
public java.lang.String getContinueShoppingUrl()
public java.lang.String getEditCartUrl()
public java.lang.String getMerchantCalculationsUrl()
public long getPlatformID()
public boolean isAcceptMerchantCoupons()
public boolean isAcceptMerchantGiftCertificates()
public boolean isMerchantCalculatedTax()
public boolean isRequestBuyerPhoneNumber()
public void setAcceptMerchantCoupons(boolean b)
b
- The boolean value.public void setAcceptMerchantGiftCertificates(boolean b)
b
- The boolean value.public void setCalculationMode(CalculationMode calcMode)
calcMode
- The CalculationMode.CalculationMode
public void setAnalyticsData(java.lang.String data)
data
- The <analytics-data> element value.public void setCartExpiration(java.util.Date date)
date
- The cart expiration.Date
public void setContinueShoppingUrl(java.lang.String url)
url
- The <continue-shopping-url> element value.public void setEditCartUrl(java.lang.String url)
url
- The <edit-cart-url> element value.public void setExpirationMinutesFromNow(int expirationMinutesFromNow)
expirationMinutesFromNow
- The length of time, in minutes, after which
the shopping cart should expire.public void setMerchantCalculatedTax(boolean b)
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. public void setMerchantCalculationsUrl(java.lang.String url)
url
- The <merchant-calculations-url> element value.public void setPlatformID(long platformId)
platformId
- The <analytics-data> element value.public void setRequestBuyerPhoneNumber(boolean b)
b
- public org.w3c.dom.Element[] getMerchantPrivateDataNodes()
Element
public void setMerchantPrivateDataNodes(org.w3c.dom.Element[] nodes)
nodes
- The <merchant-private-data> element value.Element
public void addAlternateTaxRule(java.lang.String tableName, boolean standalone, double taxRate, TaxArea taxArea)
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.TaxArea
public void addDefaultTaxRule(double taxRate, boolean shippingTaxed, TaxArea taxArea)
taxRate
- The tax rate to be applied.shippingTaxed
- Whether the shipping is taxed or not.taxArea
- The TaxArea for which this rule applies.TaxArea
public void addParameterizedUrl(java.lang.String url) throws java.io.UnsupportedEncodingException
url
- The UrlEncoded <parameterized-url> to add to the
collection.
java.io.UnsupportedEncodingException
public void addParameterizedUrl(java.lang.String url, boolean urlEncode) throws java.io.UnsupportedEncodingException
url
- The UrlEncoded <parameterized-url> to add to the
collection.urlEncode
- Set to true if you need the url to be URL encoded.
java.io.UnsupportedEncodingException
public void addParameterizedUrl(java.lang.String url, java.util.Collection parameters) throws java.io.UnsupportedEncodingException
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.
java.io.UnsupportedEncodingException
UrlParameter
public void addParameterizedUrl(java.lang.String url, boolean urlEncode, java.util.Collection parameters) throws java.io.UnsupportedEncodingException
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.
java.io.UnsupportedEncodingException
UrlParameter
public java.lang.String getPostUrl()
getPostUrl
in class AbstractCheckoutRequest
public void addFlatRateShippingMethod(java.lang.String name, float cost)
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.public void addMerchantPrivateDataNode(org.w3c.dom.Element node)
node
- The <merchant-private-data> element.public boolean isRequestInitialAuthDetails()
public void setRequestInitialAuthDetails(boolean b)
b
- The boolean value.public void setRoundingPolicy(RoundingRule rule, RoundingMode mode)
rule
- The RoundingRule.mode
- The RoundingMode.RoundingRule
,
RoundingMode
public void addCarrierCalculatedShippingOption(float price, java.lang.String shippingCompany, CarrierPickup carrierPickup, java.lang.String shippingType, float additionalFixedCharge, float additionalVariableChargePercent)
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.CarrierPickup
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)
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.DeliveryAddressCategory
,
Packaging
,
ShipFrom
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |