- <?php
- /**
- * This file contains the XML parser used to parse AWS feeds.
- *
- * @author Mauricio Diaz <madd0@users.sourceforge.net>
- * @copyright 2004 (c) Mauricio Diaz Orlich
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public License
- * @version 0.3RC1
- *
- * @package amazOOP
- */
-
- /**
- * This file is required to access of the user's preferences
- * @access private
- */
- require_once(CORE_PATH . "config/config.inc.php");
-
- /**
- * This is the class that connects to {@link http://www.amazon.com/gp/browse.html/?node=3434641 Amazon Web}
- * Services}, requests a document, downloads it and parses it.
- *
- * The data obtained from {@link http://www.amazon.com/gp/browse.html/?node=3434641 AWS} is parsed
- * and stored in different types of objects depending on the type of request made:
- * - A {@tutorial manual.blended.pkg Blended Search} will return an object of type {@link BlendedSearch};
- * - A query to a {@tutorial manual.cart.pkg Remote Shopping Cart} will return an object of type
- * {@link ShoppingCart};
- * - And finally, all {@tutorial manual.search.pkg other possible searches} will return an object
- * of type {@link ProductInfo}.
- *
- * This class is private and is only meant to be called from withing amazOOP
- * and not by the end-user, who should rather take a look at the {@link AmazonQuery}
- * class.
- *
- * @see AmazonQuery
- *
- * @author Mauricio Diaz <madd0@users.sourceforge.net>
- * @copyright 2004 (c) Mauricio Diaz Orlich
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public License
- * @version 0.3RC1
- *
- * @package amazOOP
- */
- class AmazonParser {
- /**#@+
- * @access private
- */
- /**
- * Holds handle referencing the XML parser that will be used to parse the feed.
- * @var resource
- */
- var $parser;
- /**
- * Holds result object to be returned after parsing.
- * @var ProductInfo|BlendedSearch
- */
- var $result;
- /**
- * Holds a reference to the custoemr review that is being modified
- * @var CustomerReview
- */
- var $currReview;
- /**
- * This is used to deal with the problem of features and tracks that contain
- * the '&' character being split into separate features or tracks.
- * @var boolean
- */
- var $ampersand;
- /**#@-*/
-
-
- /**
- * Deafult constrcutor for the AmazonParser.
- *
- * It prepares the parser by setting up the functions that will handle opening tags,
- * closing tags and character data.
- *
- * It also initializes some attributes.
- *
- * @return AmazonParser an XML parser for AWS feeds.
- *
- * @access private
- */
- function AmazonParser() {
- // Creates new XML parser
- if(getAmazoopConfig('UTF-8_encode'))
- $this->parser = xml_parser_create("UTF-8");
- else
- $this->parser = xml_parser_create();
-
- // Sets AmazonParser as parser
- xml_set_object($this->parser, $this);
-
- // Sets functions that will handle opening and closing tags
- // These function are tagOpen and tagClose, which can be found
- // below. These handle opening and closing tags, respectively.
- xml_set_element_handler($this->parser, "tagOpen", "tagClose");
-
- // Sets function that will handle character data.
- xml_set_character_data_handler($this->parser, "cdata");
-
- $ampersand = false;
- }
-
- /**
- * This function handles the parsing of a feed returned by AWS.
- *
- * @param string $url the URL of the feed that has to be parsed.
- * @param string $type the type of request you are making to AWS. This can
- * be either "heavy" or "lite".
- *
- * @return BlendedSearch|ProductInfoan object containing the information
- * returned by AWS.
- *
- * @access private
- */
- function parse($url, $type = "lite") {
- global $isHeavy, $allowsettimelimit;
-
- if($allowsettimelimit) set_time_limit(60);
-
- if($type == "lite")
- $isHeavy = false;
- else
- $isHeavy = true;
-
- $wait = 1;
- // Downloads response from Amazon
- for($i = 0; $i < 3; $i++){
- while(!inTime())
- sleep(1);
- if($fp = fopen($url, "r"))
- break;
- sleep($wait);
- $wait *= 2;
- }
-
- if(!$fp)
- return false;
-
- $tmpDir = getAmazoopConfig('temporary_directory');
-
- // Creates new temporary filename
- $tempName = tempnam($tmpDir, "tmp");
- // Opens (creates) new tepmorary file for writing
- $amazonInfo = fopen($tempName, "w");
-
- // Writes response to temporary file
- while($data = fread($fp, 1024))
- fwrite($amazonInfo, $data);
- // Closes link to Amazon
- fclose($amazonInfo);
- // Closes temporary file
- fclose($fp);
-
- // Opens temporary file for reading
- $fp = fopen($tempName, "r");
- // Extracts all data
- $data = fread($fp, filesize($tempName));
- // And parses it
- xml_parse($this->parser, $data, feof($fp));
- //or die(sprintf("XML error: %s at line %d", xml_error_string(xml_get_error_code($this->parser)), xml_get_current_line_number($this->parser)));
-
- // Frees parser
- xml_parser_free($this->parser);
-
- // Closes temporary file
- fclose($fp);
- // And deletes temporary file
- unlink($tempName);
-
- if($allowsettimelimit) set_time_limit(30);
-
- // Returns an object with the parsed response
- // This object may be of type ProductInfo or BlendedSearch
- // Take a look at these objects for functions to tell them apart
- return $this->result;
- }
-
- /**#@+
- * @access private
- */
- /**
- * This function handles opening tags.
- *
- * @param resource $parser is a reference to the parser doing the parsing.
- * @param string $name is the name of the tag that is being opened.
- * @param array $attrs is an array of attributes that the tag may have.
- */
- function tagOpen($parser, $name, $attrs) {
- // These global variables determine whether the response is a Blended
- // Search (isBlended = true) or a normal search (isBlended = false
- // curTag holds the current tag being analysed (used when analysing cdata)
- global $isBlended, $curTag, $isHeavy;
-
- // Sets curTag to current tag's name
- $curTag = $name;
-
- // $result references object to be returned after parsing
- $result =& $this->result;
- // $request references the request object from the result
- $request =& $result->request;
-
- // The following lines determine where the products' details depending on
- // whether the search is normal or blended
- // If the search is not blended and an array of details has been created
- //if(!$isBlended && isset($result->details))
- if(isset($result->blendedSearch) && !$result->isBlendedSearch() && isset($result->details))
- // $details references the next free field of the array which is stored
- // in $result since the latter is of type ProductInfo
- $details =& $result->details[$result->itemCount];
- // If it is a blended search
- else if($isBlended){
- // If an array of Product Lines has been created
- if(isset($result->productLines))
- // $productLine references the next free field of this array
- // in which a new product line from the search results will
- // be stored
- $productLine =& $result->productLines[$result->itemCount];
- // If an array of details has been created in the current product line
- if(isset($productLine->productInfo->details))
- // $details will reference the next free field in this array
- $details =& $productLine->productInfo->details[$productLine->productInfo->itemCount];
- }
-
- switch($name){
- // If the tag is BlendedSearch
- case "BLENDEDSEARCH":
- $isBlended = true; // $isBlended is set to true
- $result = new BlendedSearch(); // and a new BlendedSearch object is created
- // to be returned as the result of parsing
- $result->productLines = array(); // Also, the productLines array is set
- break;
- // If the tag is ProductLine
- case "PRODUCTLINE":
- $productLine = new ProductLine(); // A new Product line object is created in th BlendedSearch object
- break;
- // If the tag is ProductInfo
- case "PRODUCTINFO":
- // If it is NOT a Blended search
- if(!$isBlended){
- $result = new ProductInfo(); // A new ProductInfo object is created
- // to be returned as the result of parsing
- $result->details = array(); // Also, the details array is set
- }
- // If it IS a Blended search
- else{
- // The ProductInfo object is created as part of the currently selected Product Line
- // see $productLine above
- $productLine->productInfo = new ProductInfo();
- // Aditionally, the details array of the ProductInfo object is set
- $productLine->productInfo->details = array();
- }
- break;
- // If the tag is Request
- case "REQUEST":
- // A new Request object is created to hold the parameters of the request
- //$request = new Request();
- $request = array();
- break;
- // If the tag is Args
- case "ARGS":
- // The array args of the Request object is initialized
- //$request = array();
- break;
- // If the tag is Arg
- case "ARG":
- // The parameter is added to the array using the parameter's name as key
- $request[strtoupper($attrs['NAME'])] = rawurlencode($attrs['VALUE']);
- break;
-
- // If the tag is Details
- case "DETAILS":
- // A new Details object is created, based on whether the search
- // was lite or heavy
- if($isHeavy)
- $details = new HeavyDetails();
- else
- $details = new LiteDetails();
- // The URL to the product is stored in the url attribute
- $details->url = rawurlencode($attrs['URL']);
- break;
- // If the tag is Artists
- case "ARTISTS":
- // The array of artists is initialized
- $details->artists = array();
- break;
- // If the tag is Authors
- case "AUTHORS":
- // The array of authors is initialized
- $details->authors = array();
- break;
- // If the tag is Lists
- case "LISTS":
- // An array of ListMania lists is initialized
- $details->lists = array();
- break;
- // If the tag is Features
- case "FEATURES":
- // An array of features is initialized
- $details->features = array();
- break;
- // If the tag is Accessories
- case "ACCESSORIES":
- // An array of accerories' ASINs is created
- $details->accessories = array();
- break;
- // If the tag is SimilarProducts
- case "SIMILARPRODUCTS":
- // An array of similar products' ASINs is created
- if($result->isShoppingCart())
- $result->similarProducts = array();
- else
- $details->similarProducts = array();
- break;
- // If the tag is Reviews
- case "REVIEWS":
- // An object to hold reviews is created
- $details->reviews = new Reviews();
- break;
- // If the tag is CustomerReview
- case "CUSTOMERREVIEW":
- // A new customerReview object is created and referenced
- // as the current Review
- /*$numOfReviews = sizeof($details->reviews->customerReviews);
- $details->reviews->customerReviews[$numOfReviews] = new CustomerReview;
- $this->currReview =& $details->reviews->customerReviews[$numOfReviews];*/
- $details->reviews->customerReviews[] = new CustomerReview;
- $this->currReview =& array_last($details->reviews->customerReviews);
- break;
- // If the tag is Platforms
- case "PLATFORMS":
- // An array of similar products' ASINs is created
- $details->platforms = array();
- break;
- // If the tag is Starring
- case "STARRING":
- // An array of actors is created
- $details->starring = array();
- break;
- // If the tag is Directors
- case "DIRECTORS":
- // An array of directos is created
- $details->directors = array();
- break;
- // If the tag is Tracks
- case "TRACKS":
- // An array of rawurlencoded track names is created
- $details->tracks = array();
- break;
- // If the tag is BrowseList
- case "BROWSELIST":
- // An array is created
- $details->browseList = array();
- break;
- // If th tag is BrowseNode
- case "BROWSENODE":
- $details->browseList[] = new BrowseNode;
- break;
- // If the tag is ShoppingCartResponse
- case "SHOPPINGCARTRESPONSE":
- $result = new ShoppingCart();
- break;
- // If the tag is Items
- case "ITEMS":
- $result->items = array();
- break;
- // If the tag is Item
- case "ITEM":
- $result->items[] = new CartItem();
- break;
- }
- }
-
- /**
- * This function handles closing tags.
- *
- * @param resource $parser is a reference to the parser doing the parsing.
- * @param string $name is the name of the tag that is being closed.
- */
- function tagClose($parser, $name) {
- // These global variables determine whether the response is a Blended
- // Search (isBlended = true) or a normal search (isBlended = false
- // curTag holds the current tag being analysed (used when analysing cdata)
- global $isBlended, $curTag;
-
- // $result references object to be returned after parsing
- $result =& $this->result;
- // $request references the request object from the result
- $request =& $result->request;
-
- // The following lines determine where the products' details depending on
- // whether the search is normal or blended
- // If the search is not blended and an array of details has been created
- if(!$isBlended && isset($result->details))
- // $details references the next free field of the array which is stored
- // in $result since the latter is of type ProductInfo
- $details =& $result->details[$result->itemCount];
- // If it is a blended search
- else if($isBlended){
- // If an array of Product Lines has been created
- if(isset($result->productLines))
- // $productLine references the next free field of this array
- // in which a new product line from the search results will
- // be stored
- $productLine =& $result->productLines[$result->itemCount];
- // If an array of details has been created in the current product line
- if(isset($productLine->productInfo->details))
- // $details will reference the next free field in this array
- $details =& $productLine->productInfo->details[$productLine->productInfo->itemCount];
- }
-
- switch($name){
- // If the tag is Detils
- case "DETAILS":
- // If it is a blended search
- if($isBlended)
- // The amount of products is increased in the proper productInfo object
- $productLine->productInfo->itemCount++;
- // If it is a normal search
- else
- // The amount of products is increased in the object to be returned
- $result->itemCount++;
- break;
- // If the tag is ProductLine
- case "PRODUCTLINE":
- // The search has to be Blended
- // so the amount of lines is increased in the object to be returned
- $result->itemCount++;
- break;
- }
- // The current tag is set to empty to avoid confusion
- $curTag = "";
- }
-
- /**
- * This function handles character data.
- *
- * Character data is the text that is found between tags (e.g. <tag>character data</tag>)
- *
- * @param resource $parser is a reference to the parser doing the parsing.
- * @param string $data is the character data that has to be handled.
- */
- function cdata($parser, $data) {
- // These global variables determine whether the response is a Blended
- // Search (isBlended = true) or a normal search (isBlended = false
- // curTag holds the current tag being analysed (used when analysing cdata)
- global $isBlended, $curTag;
-
- // Converts UTF-8 Unicode to ISO-8859-1
- if(!getAmazoopConfig('UTF-8_encode'))
- $data = utf8_decode($data);
-
- $data = ereg_replace(" +", " ", $data);
-
- // $result references object to be returned after parsing
- $result =& $this->result;
- // $request references the request object from the result
- $request =& $result->request;
-
- // The following lines determine where the products' details depending on
- // whether the search is normal or blended
- // If the search is not blended and an array of details has been created
- if(!$isBlended && isset($result->details))
- // $details references the next free field of the array which is stored
- // in $result since the latter is of type ProductInfo
- $details =& $result->details[$result->itemCount];
- // If it is a blended search
- else if($isBlended){
- // If an array of Product Lines has been created
- if(isset($result->productLines))
- // $productLine references the next free field of this array
- // in which a new product line from the search results will
- // be stored
- $productLine =& $result->productLines[$result->itemCount];
-
- // If an array of details has been created in the current product line
- if(isset($productLine->productInfo->details))
- // $details will reference the next free field in this array
- $details =& $productLine->productInfo->details[$productLine->productInfo->itemCount];
- }
-
- switch($curTag){
- // If the current tag is Mode
- case "MODE":
- // The name of the mode is stored in the current product line
- $productLine->mode = rawurlencode($data);
- break;
- // If the current tag is ErrorMsg
- case "ERRORMSG":
- // The message is stored in the object to be returned
- $result->errorMsg = rawurlencode($data);
- break;
- // If the current tag is TotalResults
- case "TOTALRESULTS":
- // The number of total results is stored in the object to be returned
- if(!$isBlended)
- $result->totalResults = rawurlencode($data);
- else
- $productLine->productInfo->totalResults = rawurlencode($data);
- break;
- // If the current tag is TotalPages
- case "TOTALPAGES":
- // The number of pages is stored in the object to be returned
- if(!$isBlended)
- $result->totalPages = rawurlencode($data);
- else
- $productLine->productInfo->totalPages = rawurlencode($data);
- break;
- // If the current tag is Asin
- case "ASIN":
- // The ASIN is stored in the current product's details
- if($result->isShoppingCart()){
- $currItem =& array_last($result->items);
- $currItem->asin = rawurlencode($data);
- }
- else
- $details->asin = rawurlencode($data);
- break;
- // If the current tag is ProductName
- case "PRODUCTNAME":
- // The product's name is stored in the current product's details
- if($result->isShoppingCart()){
- $currItem =& array_last($result->items);
- $currItem->productName .= rawurlencode($data);
- }
- else
- $details->productName .= rawurlencode($data);
- break;
- // If the current tag is Catalog
- case "CATALOG":
- // The catalog is stored in the current product's details
- $details->catalog .= rawurlencode($data);
- break;
- // If the current tag is Artist
- case "ARTIST":
- // The artist's name is added at the end of the list of artists
- // of the current product
- if(strpos($data, "&") === false){
- $artists = explode("/", $data);
- foreach($artists as $artist)
- $details->artists[] = rawurlencode(trim($artist));
- }
- break;
- // If the current tag is Author
- case "AUTHOR":
- // The author's name is added at the end of the list of authors
- // of the current product
- $details->authors[] = rawurlencode($data);
- break;
- // If the current tag is Release date
- case "RELEASEDATE":
- // The product's release date is stored in the current product's details
- $details->releaseDate = rawurlencode($data);
- break;
- // If the current tag is Manufacturer
- case "MANUFACTURER":
- // The manufacturer is stored in the current product's details
- $details->manufacturer = rawurlencode($data);
- break;
- // If the current tag is ImageUrlSmall
- case "IMAGEURLSMALL":
- // The small image's URL is stored in the current product's details
- $details->imageUrl['small'] = rawurlencode($data);
- break;
- // If the current tag is ImageUrlMedium
- case "IMAGEURLMEDIUM":
- $details->imageUrl['medium'] = rawurlencode($data);
- break;
- // The medium image's URL is stored in the current product's details
- break;
- // If the current tag is ImageUrlLarge
- case "IMAGEURLLARGE":
- $details->imageUrl['large'] = rawurlencode($data);
- // The large image's URL is stored in the current product's details
- break;
- // If the current tag is ListPrice
- case "LISTPRICE":
- if($result->isShoppingCart()){
- $currItem =& array_last($result->items);
- $currItem->listPrice = rawurlencode($data);
- }
- else
- $details->listPrice = rawurlencode($data);
- // The product's list price is stored in the current product's details
- break;
- // If the current tag is ImageUrlSmall
- case "OURPRICE":
- if($result->isShoppingCart()){
- $currItem =& array_last($result->items);
- $currItem->ourPrice = rawurlencode($data);
- }
- else
- $details->ourPrice = rawurlencode($data);
- // The Amazon's price is stored in the current product's details
- break;
- // If the current tag is ImageUrlSmall
- case "USEDPRICE":
- $details->usedPrice = rawurlencode($data);
- // The lowest marketplace price is stored in the current product's details
- break;
- // If the current tag is ImageUrlSmall
- case "STATUS":
- $details->status = rawurlencode($data);
- // The status of this product's details
- break;
- // If the current tag is SalesRank
- case "SALESRANK":
- $details->salesRank = rawurlencode($data);
- break;
- // If the current tag is ListId
- case "LISTID":
- // The ListMania list ID is added at the end of the list of lists
- // of the current product
- $details->lists[] = rawurlencode($data);
- break;
- // If the current tag is Media
- case "MEDIA":
- // The media type is stored
- $details->media .= rawurlencode($data);
- break;
- // If the current tag is NumMedia
- case "NUMMEDIA":
- // The media type is stored
- $details->numMedia = rawurlencode($data);
- break;
- // If the current tag is Feature
- case "FEATURE":
- // The rawurlencoded text of the feature is stored in its array
- $numOfFeatures = sizeof($details->features);
- if($data == "&"){
- if($numOfFeatures == 0)
- $details->features[] .= rawurlencode('&');
- else
- $details->features[$numOfFeatures-1] .= rawurlencode('&');
- $this->ampersand = true;
- }
- else if($this->ampersand){
- $details->features[$numOfFeatures-1] .= rawurlencode($data);
- $this->ampersand = false;
- }
- else
- $details->features[$numOfFeatures] = rawurlencode($data);
- break;
- // If the current tag is Availability
- case "AVAILABILITY":
- // The product's availability is stored
- $details->availability .= rawurlencode($data);
- break;
- // If the current tag is Accessory
- case "ACCESSORY":
- // The the ASIN is stored
- $details->accessories[] = rawurlencode($data);
- break;
- // If the current tag is Product
- case "PRODUCT":
- // The ASIN is stored
- if($result->isShoppingCart())
- $result->similarProducts[] = $data;
- else
- $details->similarProducts[] = rawurlencode($data);
- break;
- // If the current tag is AvgCustomerRating
- case "AVGCUSTOMERRATING":
- // The average customer rating is added to the current review object
- $details->reviews->avgReview = rawurlencode($data);
- break;
- // If the current tag is TotalCustomerReviews
- case "TOTALCUSTOMERREVIEWS":
- // The number of reviews is added to the current review object
- $details->reviews->totalReviews = rawurlencode($data);
- break;
- // If the current tag is Rating
- case "RATING":
- // The rating is added to the current Customer Review
- $review =& array_last($details->reviews->customerReviews);
- $review->rating = rawurlencode($data);
- //$this->currReview->rating = rawurlencode($data);
- break;
- // If the current tag is Summary
- case "SUMMARY":
- // The rawurlencoded summary is added to the current Customer Review
- $this->currReview->summary = rawurlencode($data);
- break;
- // If the current tag is Comment
- case "COMMENT":
- // The rawurlencoded comment is added to the current Customer Review
- $this->currReview->comment .= rawurlencode($data);
- break;
- // If the current tag is Upc
- case "UPC":
- // The UPC number is stored
- $details->upc = rawurlencode($data);
- break;
- // If the current tag is Platform
- case "PLATFORM":
- // The platform is stored
- $details->platforms[] = rawurlencode($data);
- break;
- // If the current tag is EsrbRating
- case "ESRBRATING":
- // The rating is stored
- $details->esrbRating = rawurlencode($data);
- break;
- // If the current tag is MpaaRating
- case "MPAARATING":
- // The rating is stored
- $details->mpaaRating = rawurlencode($data);
- break;
- // If the current tag is TheatricalReleaseDate
- case "THEATRICALRELEASEDATE":
- // The date the movie was released in theaters is stored
- $details->theatricalReleaseDate = rawurlencode($data);
- break;
- // If the current tag is Actor
- case "ACTOR":
- // The the actor/actress is added to the list
- $details->starring[] = rawurlencode($data);
- break;
- // If the current tag is Director
- case "DIRECTOR":
- // The the director is added to the list
- $details->directors[] = rawurlencode($data);
- break;
- // If the current tag is Isbn
- case "ISBN":
- // The ISBN is stored in the current product's details
- $details->isbn = rawurlencode($data);
- break;
- // If the current tag is Track
- case "TRACK":
- // The the rawurlencoded name of the track is added to the list
- $numOfTracks = sizeof($details->tracks);
- if($data == "&"){
- $details->tracks[$numOfTracks-1] .= rawurlencode(' & ');
- $this->ampersand = true;
- }
- else if($this->ampersand){
- $details->tracks[$numOfTracks-1] .= rawurlencode($data);
- $this->ampersand = false;
- }
- else
- $details->tracks[$numOfTracks] = rawurlencode($data);
- break;
- // If the current tag is ProductDescription
- case "PRODUCTDESCRIPTION":
- // The description is stored
- $details->productDescription .= rawurlencode($data);
- break;
- // If the current tag is BrowseName
- case "BROWSENAME":
- // The browse node's name is added to the browseList
- $browseNode =& array_last($details->browseList);
-
- if($data == "&"){
- $browseNode->nodeName .= rawurlencode(' & ');
- $this->ampersand = true;
- }
- elseif($this->ampersand){
- $browseNode->nodeName .= rawurlencode($data);
- $this->ampersand = false;
- }
- else
- $browseNode->nodeName = rawurlencode($data);
- break;
- // If the current tag is BrowseId
- case "BROWSEID":
- $browseNode =& array_last($details->browseList);
- $browseNode->nodeId = $data;
- break;
- // If the current tag is Encoding
- case "ENCODING":
- $details->encoding = rawurlencode($data);
- break;
- // If the current tag is MerchantId
- case "MERCHANTID":
- $details->merchantid = rawurlencode($data);
- break;
- // If the current tag is MinPrice
- case "MINPRICE":
- $details->minPrice = rawurlencode($data);
- break;
- // If the current tag is MaxPrice
- case "MAXPRICE":
- $details->maxPrice = rawurlencode($data);
- break;
- // If the current tag is ThirdPartyNewPrice
- case "THIRDPARTYNEWPRICE":
- $details->thirdPartyNewPrice = rawurlencode($data);
- break;
- // If the current tag is CollectiblePrice
- case "COLLECTIBLEPRICE":
- $details->collectiblePrice = rawurlencode($data);
- break;
- // If the current tag is RefurbishedPrice
- case "REFURBISHEDPRICE":
- $details->refurbishedPrice = rawurlencode($data);
- break;
-
- case "ITEMID":
- $currItem =& array_last($result->items);
- $currItem->itemId = rawurlencode($data);
- break;
- case "QUANTITY":
- $currItem =& array_last($result->items);
- $currItem->qty = rawurlencode($data);
- break;
- case "CARTID":
- $result->cartID = rawurlencode($data);
- break;
- case "HMAC":
- $result->HMAC = rawurlencode($data);
- break;
- case "PURCHASEURL":
- $result->purchaseURL = rawurlencode($data);
- break;
- }
- }
- /**#@-*/
- }
- ?>