我正在尝试创建一个脚本来将项目添加到我的测试 ebay 帐户。但是我遇到了一个问题,我不确定我是否设置了错误的文件?但它似乎与文档不匹配(或者我读错了)。
我拥有的文件集是支持 527 的 PHP Toolkit。还有支持 515 的 PHP Toolkit。都来自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
这是我得到的错误: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 = 'paypal@intradesys.com';
$req->Item = $item;
$res = $cs->VerifyAddItem($req);
?>