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
Adds an Item to the GCheckout Cart
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
Add an array of gItem objects to your cart
void
addItems
(array $arr_items)
returns shipping-restriction object
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
Returns the XML GCheckout Shopping Cart
XML
getCart
()
returns shipping restriction object
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
Returns the XML Shopping Cart Signature
string
getSignature
(string $xml_cart)
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)
Add Alternate Tax Tables to the cart
void
setAlternateTaxTables
(array $arr_tax_tables)
Sets the expiration of the shopping cart. Note: google specified UTC time.
void
setCartExpirationDate
(UTC $expire_date)
-
UTC
$expire_date: Timestamp $expire_date
Add a Default Tax Table to the cart
void
setDefaultTaxTable
(
gTaxTable $default_tax_table)
Sets a mercant flat rate shipping charge
DEPRICATED: Use gShipping Object
void
setFlatRateShipping
(string $name, decimal $price, [mixed $allowed_restrictions = ""], [mixed $excluded_restrictions = ""])
-
string
$name
-
decimal
$price
Set merchant calculated shipping option.
DEPRICATED: Use gShipping object Note: this method isn't fully implemented yet. Merchant calculations require a callback uri.
void
setMercantCalculatedShipping
(string $name, decimal $price, [mixed $allowed_restrictions = ""], [mixed $excluded_restrictions = ""], unknown_type $shipping_restrictions)
-
string
$name
-
decimal
$price
-
unknown_type
$shipping_restrictions
Add a Merchant Calculations object to the array.
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
Set a Pickup Shipping Option
DEPRICATED: Use gShipping object
void
setPickup
(string $name, decimal $price)
-
string
$name
-
decimal
$price
Add an array of gShipping objects to the cart
void
setShipping
(array $arr_shipping)
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
CODE BORROWED FROM GOOGLE'S SAMPLE CODE
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
$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
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.
$hmac
_getHmacSha1
($data $data, $merchant_key $merchant_key)
-
$data
$data: message data
-
$merchant_key
$merchant_key: secret Merchant Key
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
Enter description here...
unknown
_removeTag
(unknown_type $input)
Private: Sets the XML_Serializer Options for the GCheckout XML format
void
_setSerializerOptions
()
Sets the Shipping objects in the cart.
void
_setShipping
(unknown_type $arr_shipping)
-
unknown_type
$arr_shipping
Private: Initializes the base shopping cart array
void
_setShoppingCart
()