DNforum.com - Domain Sales, Domain Forum, Domain Appraisals
 
Register Now! Welcome to Dnforum.com You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast and simple so please, join our community today! If you have any problems with the registration process or your account login, please contact us.
Go Back   DNForum - Domain Sales, Domain Forum, Domain Appraisals, Domain Registrars > Content Development > Website Development and Design Discussion > Coding/Programming/Languages
Start your Domain Reseller Business Today and Earn Money!
Reply
 
LinkBack Thread Tools Display Modes
Old 12-31-2006, 09:00 AM   #1 (permalink)
Gold Lifetime Member
 
Last Online: 05-14-2008 07:09 AM
iTrader: (0)
Join Date: Jun 2006
Posts: 9
DNF$: 121
Location: Sweden


Assign a variable to TransactionArray.Transaction.TransactionID where user ID =?

Hello,
I want to be able to find and assign a PHP variable to the Transaction ID where the UserID is a specified user though Ebays XML API.
Here is the structure of the replies I get from the XML API; http://developer.ebay.com/DevZone/XM...nsactions.html.

Now, I want to assign a variable to "TransactionArray.Transaction.TransactionID" where the "TransactionArray.Transaction.Buyer.UserID" is a specified user (theventsell in this example).

I tried with this code;
PHP Code:
<?php    
require_once('functions.php');
require_once(
'variables.php');
    
error_reporting(E_ALL);
    
//SiteID must also be set in the Request's XML
    //SiteID = 0  (US) - UK = 3, Canada = 2, Australia = 15, ....
    //SiteID Indicates the eBay site to associate the call with
    
$siteID 0;
    
//the call being made:
    
$verb 'GetItemTransactions';
    
//Regulates versioning of the XML interface for the API
    
$compatabilityLevel 433;

    
//get an array of strings containing the required headers
    
$headers buildEbayHeaders($devID$appID$certID$compatabilityLevel$siteID$verb);
    
    
///Build the request Xml string
    
$requestXmlBody '<?xml version="1.0" encoding="utf-8"?>';
    
$requestXmlBody .= '<GetItemTransactionsRequest xmlns="urn:ebay:apis:eBLBaseComponents">';
    
$requestXmlBody .= "<RequesterCredentials><eBayAuthToken>$userToken</eBayAuthToken></RequesterCredentials>";
    
$requestXmlBody .= '<ItemID>110013682918</ItemID>';
    
$requestXmlBody .= '<ModTimeFrom>2006-12-25T18:28:52.799Z</ModTimeFrom>';
    
$requestXmlBody .= '<ModTimeTo>2007-01-10T18:28:52.799Z</ModTimeTo>';
    
$requestXmlBody .= '</GetItemTransactionsRequest>';
    
    
$responseXml sendHttpRequest($requestXmlBody$serverUrl$headers);
    if(
stristr($responseXml'HTTP 404') || $responseXml == '')
        die(
'<P>Error sending request');
    
    
//Xml string is parsed and creates a DOM Document object
    
$responseDoc domxml_open_mem($responseXml);
    
    
//get any error nodes
    
$errors $responseDoc->get_elements_by_tagname('Errors');
    
    
//if there are error nodes
    
if(count($errors) > 0)
    {
        echo 
'<P><B>eBay returned the following error(s):</B>';
        
//display each error
        //Get error code, ShortMesaage and LongMessage
        
$code $errors[0]->get_elements_by_tagname('ErrorCode');
        
$shortMsg $errors[0]->get_elements_by_tagname('ShortMessage');
        
$longMsg $errors[0]->get_elements_by_tagname('LongMessage');
        
//Display code and shortmessage
        
echo '<P>'$code[0]->get_content(), ' : 'str_replace(">""&gt;"str_replace("<""&lt;"$shortMsg[0]->get_content()));
        
//if there is a long message (ie ErrorLevel=1), display it
        
if(count($longMsg) > 0)
            echo 
'<BR>'str_replace(">""&gt;"str_replace("<""&lt;"$longMsg[0]->get_content()));

    }
    else 
//no errors
    
{
     
//get results nodes
 
$transactionNodes $responseDoc->get_elements_by_tagname('Transaction');
    echo 
$transactionNodes;
    
        
//get the node containing the time and display its contents
        
$eBayTime $responseDoc->get_elements_by_tagname('Transaction');
        echo 
'<P><B>The answer is '$eBayTime[0]->get_content(), ' GMT</B>';
    }
?>
And got this when I runned it;
Code:
Array

The answer is 2.950.00.0falsenY+sHZ2PrBmdj6wVnY+sEZ2PrA2dj6wFk4CkAZKDqQydj6x9nY+seQ==oskare200@hotmail.com0falseNonetruetruefalse2006-01-01T19:59:59.000ZUSConfirmedtheventbuytrue2006-12-28T22:34:43.000ZNoVATTaxTest UseraddresscitystateNone(180) 011-1111 ext.: 1951253101053eBayfalsetrue0.0NotOfferedfalsefalse0.0falseUSPSPriority0.00.01false23Flatfalsefalse2.952.952006-12-31T11:12:49.000ZNone1NoPaymentFailureCheckoutIncomplete2006-12-31T11:12:49.000ZNoneIncompletefalse50062629452.95false0.0USPSPriority0.0eBay GMT
So it seams like what I get back is an array, the problem is that I don't know how to select and assign a variable to "TransactionArray.Transaction.TransactionID" where the "TransactionArray.Transaction.Buyer.UserID" is a specified user (theventsell in this example). Is it possible to do so and how can I do it?

If it is to any help, here is the results I get from print_r($transactionNodes);
Quote:
ArrayArray ( [0] => domelement Object ( [type] => 1 [tagname] => Transaction [0] => 6 [1] => 144378264 ) [1] => domelement Object ( [type] => 1 [tagname] => Transaction [0] => 7 [1] => 143887560 ) )
Best Regards
Oskar R

Last edited by Oskare100; 12-31-2006 at 09:08 AM.
Oskare100 is offline   Reply With Quote
Old 01-01-2007, 04:18 PM   #2 (permalink)
Gold Lifetime Member
 
Last Online: 05-14-2008 07:09 AM
iTrader: (0)
Join Date: Jun 2006
Posts: 9
DNF$: 121
Location: Sweden


Re: Assign a variable to TransactionArray.Transaction.TransactionID where user ID =?

Hello again,
Basicly, in other words, what I want to do is to find the "TransactionArray.Transaction.TransactionID" for the buyer "TransactionArray.Transaction.Buyer.UserID". It is just an XML response, is there really no one who can help me with this? I'm not even sure you need to know anything about XML to be able to help me, just have better knowledge of PHP than I. I really need help because the script I'm writing on wount work without this part and I can't figure out how to do it myself.

Thanks in advance,
/Oskar
Oskare100 is offline   Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fully Developed Site - www.BestScripts.info naqiboy Developed Websites for Sale 1 10-16-2006 10:39 AM
Buying Links for Orlando-best-of.com for each $5 / $8 / $10 DNbulk Link Trades 0 01-23-2006 11:48 AM
Can you translate japanese? TexasFilly Help Wanted! 7 06-22-2005 12:34 PM
29 Good Domains @ Cheap Prices ! zenmaster Domains for Sale (Domain Sales) - Fixed Prices Above $100 10 02-05-2005 05:40 AM
Lucky 7's Sale!!! 40 Domains from $7-$1777 (2 Char, 3 Letter, 1 Word)++ NameTower Domains for Sale (Domain Sales) - Fixed Prices Above $100 1 09-14-2003 10:06 PM


All times are GMT -4. The time now is 05:34 AM.
Copyright @2001-2008 DNForum.com

Learn Domains
Promote Domains
Research Domains
Buy Domains
Resell Domains
Park Domains
Sell Domains
Build Domains
Host Domains
Trademark Domains
Domain Domains
manage Domains
Appraise Domains