2012-02-15 11 views
1

テスト用eBayアカウントに商品を追加するためのスクリプトを作成しようとしています。しかし、私は間違ったファイルセットを持っているかどうかわからない問題が発生しましたか?しかし、それはドキュメントまで一致していないようです(または私はそれを間違って読んでいます)。Ebay Trading API ReturnPolicyType

私が持っているファイルセットは、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

ここで私は「エラーがあります私はそれがそれぞれの "タイプ"のファイルがある必要があることを理解しているCategoryTypeとAmountTypeのための1つが、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

答えて

3

あなたは新しいツールキットを入手する必要があるとしています。 ReturnPolicyは3年半前に581に追加されました。

さらに、lowest supported schemaは629です。私はツールキットの新機能として使用することをお勧めします。 eBayがPHPページをしばらく更新していないようだから、toolkit developer websiteに直接行くべきです。

希望すると便利です。

関連する問題