易趣交易API退货政策类型


Ebay Trading API ReturnPolicyType

我正在尝试创建一个脚本,将项目添加到我的测试ebay帐户中。但我遇到了一个问题,我不确定我是否有错误的文件集?但它似乎与文档不匹配(或者我读错了)。

我拥有的文件集是支持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

这是我得到的错误: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);

?>

您将不得不获得一个更新的工具包。ReturnPolicy是3年半前581年添加的。

此外,现在支持的最低模式是629。我建议您尽可能使用新的工具包。看起来易趣已经有一段时间没有更新他们的PHP页面了,所以你应该直接去工具包开发者网站看看他们有什么。

希望这能有所帮助!