Class gCart

Description

Google GCheckout / Checkout Shopping cart object

  • copyright: Expert Database Solutions, LLC 2006
  • author: Ron Howard

Located in /classes/gCart.php (line 36)


	
			
Variable Summary
Method Summary
 gCart gCart (string $mercant_id, string $mercant_key, [mixed $cart_expires = ''], [mixed $merchant_private_data = ""])
 void addItem (unknown_type $item_name, unknown_type $item_description, [unknown_type $quantity = 1], unknown_type $unit_price, [unknown_type $tt_selector = ""], [unknown_type $private_item_data = ""])
 void addItems (array $arr_items)
 unknown getAllowedAreas (unknown_type $country_area, unknown_type $arr_states, unknown_type $arr_zips)
 XML getCart ()
 unknown getExcludedAreas (unknown_type $country_area, unknown_type $arr_states, unknown_type $arr_zips)
 string getSignature (string $xml_cart)
 void postCart (unknown_type $xml_cart)
 void setAlternateTaxTables (array $arr_tax_tables)
 void setCartExpirationDate (UTC $expire_date)
 void setDefaultTaxTable (gTaxTable $default_tax_table)
 void setFlatRateShipping (string $name, decimal $price, [mixed $allowed_restrictions = ""], [mixed $excluded_restrictions = ""])
 void setMercantCalculatedShipping (string $name, decimal $price, [mixed $allowed_restrictions = ""], [mixed $excluded_restrictions = ""], unknown_type $shipping_restrictions)
 void setMerchantCalculations (gMerchantCalculations $MerchantCalculations)
 void setMerchantCheckoutFlowSupport ([unknown_type $edit_cart_url = ""], [unknown_type $continue_shopping_url = ""], [unknown_type $request_buyer_phone_number = false], [unknown_type $platform_id = null])
 void setPickup (string $name, decimal $price)
 void setShipping (array $arr_shipping)
 void _getAllowedAreas (unknown_type $country_area, unknown_type $arr_states, unknown_type $arr_zips, [unknown_type $type = "allowed"])
 $response _getCurlResponse ($request $request, $post_url $post_url)
 $hmac _getHmacSha1 ($data $data, $merchant_key $merchant_key)
 unknown _getShippingArray (unknown_type $shipping_type, unknown_type $name, unknown_type $price, [mixed $allowed_restrictions = ""], [mixed $excluded_restrictions = ""], unknown_type $shipping_restrictions)
 unknown _removeTag (unknown_type $input)
 void _setShipping (unknown_type $arr_shipping)
Variables
mixed $_alt_tax_table_serializer_options (line 45)
mixed $_arr_shopping_cart (line 40)
mixed $_items (line 49)
mixed $_mercant_id (line 38)
mixed $_mercant_key (line 39)
mixed $_merchant_calculations (line 51)
mixed $_merchant_private_data (line 50)
mixed $_php_version (line 37)
mixed $_platform_id (line 52)
mixed $_remove_tags (line 46)
mixed $_serializer_options (line 41)
mixed $_shipping (line 48)
mixed $_state_area_serializer_options (line 44)
mixed $_state_serializer_options (line 42)
mixed $_tax_tables (line 47)
mixed $_zip_serializer_options (line 43)
Methods
Constructor gCart (line 61)

phpGCheckout Constructor

gCart gCart (string $mercant_id, string $mercant_key, [mixed $cart_expires = ''], [mixed $merchant_private_data = ""])
  • string $mercant_key
  • string $mercant_id: mercant_id
addItem (line 209)

Adds an Item to the GCheckout Cart

  • access: public
void addItem (unknown_type $item_name, unknown_type $item_description, [unknown_type $quantity = 1], unknown_type $unit_price, [unknown_type $tt_selector = ""], [unknown_type $private_item_data = ""])
  • unknown_type $item_name
  • unknown_type $item_description
  • unknown_type $quantity
  • unknown_type $unit_price
  • unknown_type $tt_selector
  • unknown_type $private_item_data
addItems (line 266)

Add an array of gItem objects to your cart

  • access: public
void addItems (array $arr_items)
  • array $arr_items
getAllowedAreas (line 376)

returns shipping-restriction object

  • access: public
unknown getAllowedAreas (unknown_type $country_area, unknown_type $arr_states, unknown_type $arr_zips)
  • unknown_type $country_area
  • unknown_type $arr_states
  • unknown_type $arr_zips
getCart (line 125)

Returns the XML GCheckout Shopping Cart

  • return: GCheckout Checkout Shopping Cart
  • access: public
XML getCart ()
getExcludedAreas (line 391)

returns shipping restriction object

  • access: public
unknown getExcludedAreas (unknown_type $country_area, unknown_type $arr_states, unknown_type $arr_zips)
  • unknown_type $country_area
  • unknown_type $arr_states
  • unknown_type $arr_zips
getSignature (line 191)

Returns the XML Shopping Cart Signature

  • access: public
string getSignature (string $xml_cart)
  • string $xml_cart
postCart (line 472)

Posts cart to Google directly using CURL

Note: lib_curl and lib_openssl must be installed on the server to use this alternate mechanism for posting carts to Google Checkout

void postCart (unknown_type $xml_cart)
  • unknown_type $xml_cart
setAlternateTaxTables (line 422)

Add Alternate Tax Tables to the cart

  • access: public
void setAlternateTaxTables (array $arr_tax_tables)
  • array $arr_tax_tables
setCartExpirationDate (line 286)

Sets the expiration of the shopping cart. Note: google specified UTC time.

  • access: public
void setCartExpirationDate (UTC $expire_date)
  • UTC $expire_date: Timestamp $expire_date
setDefaultTaxTable (line 433)

Add a Default Tax Table to the cart

  • access: public
void setDefaultTaxTable (gTaxTable $default_tax_table)
setFlatRateShipping (line 302)

Sets a mercant flat rate shipping charge

DEPRICATED: Use gShipping Object

  • access: public
void setFlatRateShipping (string $name, decimal $price, [mixed $allowed_restrictions = ""], [mixed $excluded_restrictions = ""])
  • string $name
  • decimal $price
setMercantCalculatedShipping (line 351)

Set merchant calculated shipping option.

DEPRICATED: Use gShipping object Note: this method isn't fully implemented yet. Merchant calculations require a callback uri.

  • access: public
void setMercantCalculatedShipping (string $name, decimal $price, [mixed $allowed_restrictions = ""], [mixed $excluded_restrictions = ""], unknown_type $shipping_restrictions)
  • string $name
  • decimal $price
  • unknown_type $shipping_restrictions
setMerchantCalculations (line 457)

Add a Merchant Calculations object to the array.

  • access: public
void setMerchantCalculations (gMerchantCalculations $MerchantCalculations)
setMerchantCheckoutFlowSupport (line 405)

Set's the Merchante Checkout Flow Support

void setMerchantCheckoutFlowSupport ([unknown_type $edit_cart_url = ""], [unknown_type $continue_shopping_url = ""], [unknown_type $request_buyer_phone_number = false], [unknown_type $platform_id = null])
  • unknown_type $edit_cart_url
  • unknown_type $continue_shopping_url
  • unknown_type $request_buyer_phone_number
  • unknown_type $platform_id
setPickup (line 326)

Set a Pickup Shipping Option

DEPRICATED: Use gShipping object

  • access: public
void setPickup (string $name, decimal $price)
  • string $name
  • decimal $price
setShipping (line 445)

Add an array of gShipping objects to the cart

  • access: public
void setShipping (array $arr_shipping)
  • array $arr_shipping
_getAllowedAreas (line 539)

Enter description here...

void _getAllowedAreas (unknown_type $country_area, unknown_type $arr_states, unknown_type $arr_zips, [unknown_type $type = "allowed"])
  • unknown_type $country_area
  • unknown_type $arr_states
  • unknown_type $arr_zips
  • unknown_type $type
_getCurlResponse (line 753)

CODE BORROWED FROM GOOGLE'S SAMPLE CODE

  • Thanks Google!!

The GetCurlResponse function sends an API request to Google Checkout and returns the response. The HTTP Basic Authentication scheme is used to authenticate the message.

This function utilizes cURL, client URL library functions. cURL is supported in PHP 4.0.2 or later versions, documented at http://us2.php.net/curl

  • return: synchronous response from the Google Checkout server
$response _getCurlResponse ($request $request, $post_url $post_url)
  • $request $request: XML API request
  • $post_url $post_url: URL address to which the request will be sent
_getHmacSha1 (line 699)

Hash function that computes HMAC-SHA1 value.

This function is used to produce the signature that is reproduced and compared on the other end for data integrity.

  • return: value of the calculated HMAC-SHA1
$hmac _getHmacSha1 ($data $data, $merchant_key $merchant_key)
  • $data $data: message data
  • $merchant_key $merchant_key: secret Merchant Key
_getShippingArray (line 588)

Enter description here...

unknown _getShippingArray (unknown_type $shipping_type, unknown_type $name, unknown_type $price, [mixed $allowed_restrictions = ""], [mixed $excluded_restrictions = ""], unknown_type $shipping_restrictions)
  • unknown_type $shipping_type
  • unknown_type $name
  • unknown_type $price
  • unknown_type $shipping_restrictions
_removeTag (line 730)

Enter description here...

unknown _removeTag (unknown_type $input)
  • unknown_type $input
_setSerializerOptions (line 628)

Private: Sets the XML_Serializer Options for the GCheckout XML format

void _setSerializerOptions ()
_setShipping (line 522)

Sets the Shipping objects in the cart.

void _setShipping (unknown_type $arr_shipping)
  • unknown_type $arr_shipping
_setShoppingCart (line 678)

Private: Initializes the base shopping cart array

void _setShoppingCart ()

Documentation generated on Mon, 04 Dec 2006 10:47:07 -0500 by phpDocumentor 1.3.0RC3