2012-02-15 95 views
1

我正在尝试创建一个脚本来添加项目到我的测试易趣帐户。但是我遇到了一个问题,我不确定我是否有错误的文件集?但它似乎不符合文档(或者我读错了)。易趣贸易API ReturnPolicyType

我拥有的文件集是527支持的PHP工具包。还有支持515的PHP工具包。无论从https://www.x.com/developers/ebay/php-accelerator-toolkit-ebay-trading-api-edition

我发现这个伟大的脚本,通过对栈溢出 https://github.com/iloveitaly/ebay-php/blob/master/eBayCommon.php

另一个问题,我在在线帮助文​​件,这里一直在寻找:http://developer.ebay.com/devzone/xml/docs/WebHelp/wwhelp/wwhimpl/js/html/wwhelp.htm

这里是我的错误m得到:PHP致命错误:没有找到类'ReturnPolicyType'

我明白它的方式是每个“类型”应该有一个文件有一个用于CategoryType和AmountType但没有ReturnPolicyType文件。并没有提及任何我有任何文件..我看这完全错误?

require_once '../EbatNs/EbatNs_ServiceProxy.php'; 
require_once '../EbatNs/EbatNs_Logger.php'; 
require_once '../EbatNs/VerifyAddItemRequestType.php'; 
require_once '../EbatNs/AddItemRequestType.php'; 
require_once '../EbatNs/ItemType.php'; 
    require_once '../EbatNs/ItemConditionCodeType.php'; 
    require_once '../EbatNs/GetMyeBaySellingRequestType.php'; 
    require_once '../EbatNs/GetMyeBaySellingResponseType.php'; 
    require_once '../EbatNs/GetItemRequestType.php'; 

$session = new EbatNs_Session('config/ebay.config.php'); 

$cs = new EbatNs_ServiceProxy($session); 
$cs->_logger = new EbatNs_Logger(); 

$req = new VerifyAddItemRequestType(); 

$item = new ItemType(); 
$item->BuyItNowPrice; 
$item->Description = 'test ��� � <b>Some bold text</b>'; 
$item->ListingDuration = 'Days_7'; 
$item->Title = '��� test-titel'; 
$item->Currency = 'EUR'; 
$item->ListingType = 'Chinese'; 
$item->Quantity = 1; 
$item->StartPrice = new AmountType(); 
$item->StartPrice->setTypeValue('1.0'); 
$item->StartPrice->setTypeAttribute('currencyID', 'EUR'); 
$item->Country = 'GB'; 
$item->Location = '-- not given --'; 
$item->ConditionID = '1'; 
$item->PrimaryCategory = new CategoryType(); 
$item->PrimaryCategory->CategoryID = 11450; 
    $returnPolicy = new ReturnPolicyType(); 
    $returnPolicy->setRefundOption($sellerConfig['refund']['option']); 
    $returnPolicy->setRefund($sellerConfig['refund']['option']); 
    $returnPolicy->setReturnsWithinOption($sellerConfig['refund']['within']); 
    $returnPolicy->setReturnsWithin($sellerConfig['refund']['within']); 
    $returnPolicy->setReturnsAcceptedOption($sellerConfig['refund']['returns']); 
    $returnPolicy->setReturnsAccepted($sellerConfig['refund']['returns']); 
    $returnPolicy->setDescription($sellerConfig['refund']['description']); 
    $returnPolicy->setShippingCostPaidByOption($sellerConfig['refund']['paidby']); 
    $returnPolicy->setShippingCostPaidBy($sellerConfig['refund']['paidby']); 
    $item->ReturnPolicy = $returnPolicy; 

$item->Site = 'UK'; 
    $item->ShipToLocations[]="Europe"; 
$item->PaymentMethods[] = 'PayPal'; 
$item->PayPalEmailAddress = '[email protected]'; 

$req->Item = $item; 
$res = $cs->VerifyAddItem($req); 

?>

+0

您能否成功添加项目? – user123 2014-05-01 04:18:09

回答

3

你将必须得到一个较新的工具包。 ReturnPolicy在5年前的581年中增加了。

此外,lowest supported schema现在是629.我会推荐使用新的工具箱,如下所示。看起来eBay并没有更新他们的PHP页面,所以你应该直接去toolkit developer website看看他们在那里有什么。

希望这会有所帮助!