shrikant_77 0 Newbie Poster
if(isset($_POST['listingType']))
	{
        ini_set('magic_quotes_gpc', false);    // magic quotes will only confuse things like escaping apostrophe
		//Get the item entered
        $listingType     = $_POST['listingType'];
        $primaryCategory = $_POST['primaryCategory'];
	
        $itemTitle       = $_POST['itemTitle'];
        if(get_magic_quotes_gpc()) {
            // print "stripslashes!!! <br>\n";
            $itemDescription = stripslashes($_POST['itemDescription']);
        } else {
            $itemDescription = $_POST['itemDescription'];
        }
        $itemDescription = $_POST['itemDescription'];
        $listingDuration = $_POST['listingDuration'];
        $startPrice      = $_POST['startPrice'];
        $buyItNowPrice   = $_POST['buyItNowPrice'];
        $quantity        = $_POST['quantity'];
        
        if ($listingType == 'StoresFixedPrice') {
          $buyItNowPrice = 0.0;   // don't have BuyItNow for SIF
          $listingDuration = 'GTC';
        }
        
        if ($listingType == 'Dutch') {
          $buyItNowPrice = 0.0;   // don't have BuyItNow for Dutch
        }
        	
		//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 = 203;
		//the call being made:
		$verb = 'AddItem';
		        $requestXmlBody  = '<?xml version="1.0" encoding="utf-8" ?>';
                $requestXmlBody .= '<AddItemRequest xmlns="urn:ebay:apis:eBLBaseComponents">';
                $requestXmlBody .= "<RequesterCredentials><eBayAuthToken>$userToken</eBayAuthToken></RequesterCredentials>";
                $requestXmlBody .= '<DetailLevel>ReturnAll</DetailLevel>';
                $requestXmlBody .= '<ErrorLanguage>en_IN</ErrorLanguage>';
                $requestXmlBody .= "<Version>$compatabilityLevel</Version>";
                $requestXmlBody .= '<Item>';
                $requestXmlBody .= '<Site>India</Site>';
                $requestXmlBody .= "<BuyItNowPrice currencyID=\"INR\">$buyItNowPrice</BuyItNowPrice>";
                $requestXmlBody .= '<Country>IN</Country>';
                $requestXmlBody .= '<Currency>INR</Currency>';
                $requestXmlBody .= "<ListingDuration>$listingDuration</ListingDuration>";
        		$requestXmlBody .= "<ListingType>$listingType</ListingType>";
                $requestXmlBody .= '<Location><![CDATA[pune, MH]]></Location>';
			
			 
				$requestXmlBody .=  '<PaymentMethods>PaisaPayAccepted</PaymentMethods>' ;
    			//$requestXmlBody .=  '<PaymentMethods>COD</PaymentMethods>';
				$requestXmlBody .='<PictureDetails>';
				$requestXmlBody .='<PictureURL>http://i.ebayimg.sandbox.ebay.com/00/s/MTAwMFg2NjA=/$(KGrHqQOKo0E5k(HyHORBOg(R+zg0Q~~60_1.JPG?set_id=8800005007</PictureURL>';
				$requestXmlBody .='</PictureDetails>';
			    $requestXmlBody .= "<CategoryMappingAllowed>true</CategoryMappingAllowed>";
				$requestXmlBody .= "<PrimaryCategory><CategoryID>133153</CategoryID></PrimaryCategory>"; 
			   $requestXmlBody .=  '<PaymentDetails> <HoursToDeposit>48</HoursToDeposit> <DaysToFullPayment>7</DaysToFullPayment> </PaymentDetails>' ;
                $requestXmlBody .= "<Quantity>$quantity</Quantity>";
                $requestXmlBody .= '<RegionID>0</RegionID>';
				$requestXmlBody .= "<StartPrice>$startPrice</StartPrice>";
				$requestXmlBody .='<ShippingDetails>
									<ShippingServiceOptions>
									<ShippingService>IN_Express</ShippingService>
								    <ShippingServiceCost currencyID="INR">5.0</ShippingServiceCost>
									<ShippingServicePriority>1</ShippingServicePriority>
									<ExpeditedService>false</ExpeditedService>
								    </ShippingServiceOptions>
									<ShippingType>Flat</ShippingType>
									</ShippingDetails>';
				$requestXmlBody.='<DispatchTimeMax>3</DispatchTimeMax>';
 				$requestXmlBody .= "<Title><![CDATA[$itemTitle]]></Title>";
                $requestXmlBody .= "<Description><![CDATA[$itemDescription]]></Description>";
                $requestXmlBody .= "<ReturnPolicy><ReturnsAcceptedOption>ReturnsNotAccepted</ReturnsAcceptedOption></ReturnPolicy>";
                $requestXmlBody .= '</Item>';
                $requestXmlBody .= '</AddItemRequest>';
				
				
				
		///Build the request Xml string
	     //echo     $requestXmlBody; exit;
		
        //Create a new eBay session with all details pulled in from included keys.php
	    $session = new eBaySession($userToken, $devID, $appID, $certID, $serverUrl, $compatabilityLevel, $siteID, $verb);
		
		//send the request and get response
		$responseXml = $session->sendHttpRequest($requestXmlBody);
		if(stristr($responseXml, 'HTTP 404') || $responseXml == '')
			die('<P>Error sending request');
		
		//Xml string is parsed and creates a DOM Document object
		$responseDoc = new DomDocument();
		$responseDoc->loadXML($responseXml);
			
		//get any error nodes
		$errors = $responseDoc->getElementsByTagName('Errors');
		
		//if there are error nodes
		if($errors->length > 0)
		{
			echo '<P><B>eBay returned the following error(s):</B>';
			//display each error
			//Get error code, ShortMesaage and LongMessage
			$code     = $errors->item(0)->getElementsByTagName('ErrorCode');
			$shortMsg = $errors->item(0)->getElementsByTagName('ShortMessage');
			$longMsg  = $errors->item(0)->getElementsByTagName('LongMessage');
			//Display code and shortmessage
			echo '<P>', $code->item(0)->nodeValue, ' : ', str_replace(">", "&gt;", str_replace("<", "&lt;", $shortMsg->item(0)->nodeValue));
			//if there is a long message (ie ErrorLevel=1), display it
			if(count($longMsg) > 0)
				echo '<BR>', str_replace(">", "&gt;", str_replace("<", "&lt;", $longMsg->item(0)->nodeValue));
	
		} else { //no errors
            
			//get results nodes
            $responses = $responseDoc->getElementsByTagName("AddItemResponse");
            foreach ($responses as $response) {
              $acks = $response->getElementsByTagName("Ack");
              $ack   = $acks->item(0)->nodeValue;
              echo "Ack = $ack <BR />\n";   // Success if successful
              
              $endTimes  = $response->getElementsByTagName("EndTime");
              $endTime   = $endTimes->item(0)->nodeValue;
              echo "endTime = $endTime <BR />\n";
              
              $itemIDs  = $response->getElementsByTagName("ItemID");
              $itemID   = $itemIDs->item(0)->nodeValue;
              echo "itemID = $itemID <BR />\n";
              
              $linkBase = "http://cgi.sandbox.ebay.com/ws/eBayISAPI.dll?ViewItem&item=";
              echo "<a href=$linkBase" . $itemID . ">$itemTitle</a> <BR />";
              
              $feeNodes = $responseDoc->getElementsByTagName('Fee');
              foreach($feeNodes as $feeNode) {
                $feeNames = $feeNode->getElementsByTagName("Name");
                if ($feeNames->item(0)) {
                    $feeName = $feeNames->item(0)->nodeValue;
                    $fees = $feeNode->getElementsByTagName('Fee');  // get Fee amount nested in Fee
                    $fee = $fees->item(0)->nodeValue;
                    if ($fee > 0.0) {
                        if ($feeName == 'ListingFee') {
                          printf("<B>$feeName : %.2f </B><BR>\n", $fee); 
                        } else {
                          printf("$feeName : %.2f <BR>\n", $fee);
                        }      
                    }  // if $fee > 0
                } // if feeName
              } // foreach $feeNode
            
            } // foreach response
            
		} // if $errors->length > 0
	}

I got following error
20159 : You have either not registered or are having problems with your payment method registration.
You have either not registered or are having problems with your payment method registration.
how to solve plz help in india site