Php 易趣交易API错误:您需要创建卖家';s账户

Php 易趣交易API错误:您需要创建卖家';s账户,php,paypal,ebay-api,ebay-sdk,Php,Paypal,Ebay Api,Ebay Sdk,我正在使用 当我尝试将fixedprice项目添加到sandbox-一切正常时,我只是将凭据更改为生产模式,并得到一个错误: 您需要创建一个卖家帐户。然后才能列出此项目 我们需要一些附加信息来创建卖家帐户 如何修复此错误?我有卖家帐户和链接贝宝帐户(和里面的钱),但我不确定我用的是同一个帐户,因为我做了开发程序的帐户。 如何在开发者程序中使用我的卖家帐户? 请帮忙 我拥有的代码如下: use \DTS\eBaySDK\Constants; //Trading API use \DTS\eBayS

我正在使用

当我尝试将fixedprice项目添加到sandbox-一切正常时,我只是将凭据更改为生产模式,并得到一个错误:

您需要创建一个卖家帐户。然后才能列出此项目 我们需要一些附加信息来创建卖家帐户

如何修复此错误?我有卖家帐户和链接贝宝帐户(和里面的钱),但我不确定我用的是同一个帐户,因为我做了开发程序的帐户。 如何在开发者程序中使用我的卖家帐户?

请帮忙

我拥有的代码如下:

use \DTS\eBaySDK\Constants;
//Trading API
use \DTS\eBaySDK\Trading\Services;
use \DTS\eBaySDK\Trading\Types;
use \DTS\eBaySDK\Trading\Enums;

//Fiding API
//use \DTS\eBaySDK\Finding\Services;
//use \DTS\eBaySDK\Finding\Types;

class EbayController extends BaseController {

    protected $TOKEN = 'Token here';
    protected $service;

    function __construct()
    {
        $this->service = new Services\TradingService(array(
            'apiVersion' => '911',
            'siteId' => 0,
            'appId' => 'My app id here',
            'sandbox' => false,
            'certId' => 'My cert id here',
            'devId' => 'My dev id here',
                //'debug' => true
        ));
    }

    function test()
    {
        $this->addProductFixedPrice();
        echo '<br />//-------------------------------------------------<br />';




        $request = new Types\GeteBayOfficialTimeRequestType();
        $request->RequesterCredentials = new Types\CustomSecurityHeaderType();
        $request->RequesterCredentials->eBayAuthToken = $this->TOKEN;
        $response = $this->service->geteBayOfficialTime($request);

        if ( $response->Ack !== 'Success' )
        {
            if ( isset($response->Errors) )
            {
                foreach ( $response->Errors as $error )
                {
                    printf("ShortMessage Error: %s\n", $error->ShortMessage . '<br />');
                    printf("LongMessage Error: %s\n", $error->LongMessage . '<br />');
                    printf("ErrorClassification Error: %s\n", $error->ErrorClassification . '<br />');
                    printf("ErrorCode Error: %s\n", $error->ErrorCode . '<br />');
                    //printf("ErrorParameters Error: %s\n", $error->ErrorParameters . '<br />');
                    printf("SeverityCode Error: %s\n", $error->SeverityCode . '<br />');
                    printf("UserDisplayHint Error: %s\n", $error->UserDisplayHint . '<br />');
                }
            }
        }
        else
        {
            printf($response->Ack . "    --   The official eBay time is: %s\n", $response->Timestamp->format('H:i (\G\M\T) \o\n l jS F Y'));
        }
    }

    function addProductFixedPrice()
    {
        $request = new Types\AddFixedPriceItemRequestType();
        /**
         * An user token is required when using the Trading service.
         *
         * For more information about getting your user tokens, see:
         * http://devbay.net/sdk/guides/application-keys/
         */
        $request->RequesterCredentials = new Types\CustomSecurityHeaderType();
        $request->RequesterCredentials->eBayAuthToken = $this->TOKEN;
        /**
         * Begin creating the fixed price item.
         */
        $item = new Types\ItemType();
        /**
         * We want a multiple quantity fixed price listing.
         */
        $item->ListingType = Enums\ListingTypeCodeType::C_FIXED_PRICE_ITEM;
        $item->Quantity = 99;
        /**
         * Let the listing be automatically renewed every 30 days until cancelled.
         */
        $item->ListingDuration = Enums\ListingDurationCodeType::C_GTC;
        /**
         * The cost of the item is $19.99.
         * Note that we don't have to specify a currency as eBay will use the site id
         * that we provided earlier to determine that it will be United States Dollars (USD).
         */
        $item->StartPrice = new Types\AmountType(array('value' => 19.99));
        /**
         * Allow buyers to submit a best offer.
         */
        $item->BestOfferDetails = new Types\BestOfferDetailsType();
        $item->BestOfferDetails->BestOfferEnabled = true;
        /**
         * Automatically accept best offers of $17.99 and decline offers lower than $15.99.
         */
        $item->ListingDetails = new Types\ListingDetailsType();
        $item->ListingDetails->BestOfferAutoAcceptPrice = new Types\AmountType(array('value' => 17.99));
        $item->ListingDetails->MinimumBestOfferPrice = new Types\AmountType(array('value' => 15.99));
        /**
         * Provide a title and description and other information such as the item's location.
         * Note that any HTML in the title or description must be converted to HTML entities.
         */
        $item->Title = 'H2 Bits &amp; Bobs 4';
        $item->Description = '&lt;H1&gt;H2 Bits &amp; Bobs&lt;/H1&gt;&lt;p&gt;Just some stuff I found.&lt;/p&gt;';
        $item->SKU = 'ABC-001';
        $item->Country = 'US';
        $item->Location = 'Beverly Hills';
        $item->PostalCode = '90210';
        /**
         * This is a required field.
         */
        $item->Currency = 'USD';
        /**
         * Display a picture with the item.
         */
        $item->PictureDetails = new Types\PictureDetailsType();
        $item->PictureDetails->GalleryType = Enums\GalleryTypeCodeType::C_GALLERY;
        $item->PictureDetails->PictureURL = array('https://pixabay.com/get/1d9c26b3a1355d638606/1434976441/rosa-817121_1280.jpg?direct');
        /**
         * List item in the Books > Audiobooks (29792) category.
         */
        $item->PrimaryCategory = new Types\CategoryType();
        $item->PrimaryCategory->CategoryID = '29792';
        /**
         * Tell buyers what condition the item is in.
         * For the category that we are listing in the value of 1000 is for Brand New.
         */
        $item->ConditionID = 1000;
        /**
         * Buyers can use one of two payment methods when purchasing the item.
         * Visa / Master Card
         * PayPal
         * The item will be dispatched within 1 business days once payment has cleared.
         * Note that you have to provide the PayPal account that the seller will use.
         * This is because a seller may have more than one PayPal account.
         */
        $item->PaymentMethods = array(
            'VisaMC',
            'PayPal'
        );
        $item->PayPalEmailAddress = 'example@example.com';
        $item->DispatchTimeMax = 1;
        /**
         * Setting up the shipping details.
         * We will use a Flat shipping rate for both domestic and international.
         */
        $item->ShippingDetails = new Types\ShippingDetailsType();
        $item->ShippingDetails->ShippingType = Enums\ShippingTypeCodeType::C_FLAT;
        /**
         * Create our first domestic shipping option.
         * Offer the Economy Shipping (1-10 business days) service at $2.00 for the first item.
         * Additional items will be shipped at $1.00.
         */
        $shippingService = new Types\ShippingServiceOptionsType();
        $shippingService->ShippingServicePriority = 1;
        $shippingService->ShippingService = 'Other';
        $shippingService->ShippingServiceCost = new Types\AmountType(array('value' => 2.00));
        $shippingService->ShippingServiceAdditionalCost = new Types\AmountType(array('value' => 1.00));
        $item->ShippingDetails->ShippingServiceOptions[] = $shippingService;
        /**
         * Create our second domestic shipping option.
         * Offer the USPS Parcel Select (2-9 business days) at $3.00 for the first item.
         * Additional items will be shipped at $2.00.
         */
        $shippingService = new Types\ShippingServiceOptionsType();
        $shippingService->ShippingServicePriority = 2;
        $shippingService->ShippingService = 'USPSParcel';
        $shippingService->ShippingServiceCost = new Types\AmountType(array('value' => 3.00));
        $shippingService->ShippingServiceAdditionalCost = new Types\AmountType(array('value' => 2.00));
        $item->ShippingDetails->ShippingServiceOptions[] = $shippingService;
        /**
         * Create our first international shipping option.
         * Offer the USPS First Class Mail International service at $4.00 for the first item.
         * Additional items will be shipped at $3.00.
         * The item can be shipped Worldwide with this service.
         */
        $shippingService = new Types\InternationalShippingServiceOptionsType();
        $shippingService->ShippingServicePriority = 1;
        $shippingService->ShippingService = 'USPSFirstClassMailInternational';
        $shippingService->ShippingServiceCost = new Types\AmountType(array('value' => 4.00));
        $shippingService->ShippingServiceAdditionalCost = new Types\AmountType(array('value' => 3.00));
        $shippingService->ShipToLocation = array('WorldWide');
        $item->ShippingDetails->InternationalShippingServiceOption[] = $shippingService;
        /**
         * Create our second international shipping option.
         * Offer the USPS Priority Mail International (6-10 business days) service at $5.00 for the first item.
         * Additional items will be shipped at $4.00.
         * The item will only be shipped to the following locations with this service.
         * N. and S. America
         * Canada
         * Australia
         * Europe
         * Japan
         */
        $shippingService = new Types\InternationalShippingServiceOptionsType();
        $shippingService->ShippingServicePriority = 2;
        $shippingService->ShippingService = 'USPSPriorityMailInternational';
        $shippingService->ShippingServiceCost = new Types\AmountType(array('value' => 5.00));
        $shippingService->ShippingServiceAdditionalCost = new Types\AmountType(array('value' => 4.00));
        $shippingService->ShipToLocation = array(
            'Americas',
            'CA',
            'AU',
            'Europe',
            'JP'
        );
        $item->ShippingDetails->InternationalShippingServiceOption[] = $shippingService;
        /**
         * The return policy.
         * Returns are accepted.
         * A refund will be given as money back.
         * The buyer will have 14 days in which to contact the seller after receiving the item.
         * The buyer will pay the return shipping cost.
         */
        $item->ReturnPolicy = new Types\ReturnPolicyType();
        $item->ReturnPolicy->ReturnsAcceptedOption = 'ReturnsAccepted';
        $item->ReturnPolicy->RefundOption = 'MoneyBack';
        $item->ReturnPolicy->ReturnsWithinOption = 'Days_14';
        $item->ReturnPolicy->ShippingCostPaidByOption = 'Buyer';
        /**
         * Finish the request object.
         */
        $request->Item = $item;
        /**
         * Send the request to the AddFixedPriceItem service operation.
         *
         * For more information about calling a service operation, see:
         * http://devbay.net/sdk/guides/getting-started/#service-operation
         */
        $response = $this->service->addFixedPriceItem($request);
        /**
         * Output the result of calling the service operation.
         *
         * For more information about working with the service response object, see:
         * http://devbay.net/sdk/guides/getting-started/#response-object
         */
        if ( isset($response->Errors) )
        {
            foreach ( $response->Errors as $error )
            {
                printf("%s: %s\n%s\n\n", $error->SeverityCode === Enums\SeverityCodeType::C_ERROR ? 'Error' : 'Warning', $error->ShortMessage, $error->LongMessage
                );
            }
        }
        if ( $response->Ack !== 'Failure' )
        {
            printf("The item was listed to the eBay Sandbox with the Item number %s\n", $response->ItemID
            );
        }
    }}
使用\DTS\eBaySDK\Constants;
//交易API
使用\DTS\eBaySDK\Trading\Services;
使用\DTS\eBaySDK\Trading\Types;
使用\DTS\eBaySDK\Trading\Enums;
//菲丁API
//使用\DTS\eBaySDK\Finding\Services;
//使用\DTS\eBaySDK\Finding\Types;
类EbayController扩展BaseController{
受保护的$TOKEN='TOKEN here';
受保护的服务;
函数_u构造()
{
$this->service=new Services\TradingService(数组)(
“apiVersion”=>“911”,
'siteId'=>0,
'appId'=>'My app id here',
“沙盒”=>错误,
'certId'=>'我的证书id在此',
'devId'=>'My dev id here',
//“调试”=>true
));
}
功能测试()
{
$this->addProductFixedPrice();
回音“
/>---------------------------------------
”; $request=new-Types\GeteBayOfficialTimeRequestType(); $request->RequesterCredentials=新类型\CustomSecurityHeaderType(); $request->RequesterCredentials->eBayAuthToken=$this->TOKEN; $response=$this->service->geteBayOfficialTime($request); 如果($response->Ack!==“Success”) { if(设置($response->Errors)) { foreach($response->Errors as$error) { printf(“短消息错误:%s\n,$Error->ShortMessage.
”); printf(“LongMessage错误:%s\n,$Error->LongMessage.”
); printf(“错误分类错误:%s\n”,$Error->ErrorClassification.
); printf(“错误代码错误:%s\n”,$Error->ErrorCode.
); //printf(“ErrorParameters错误:%s\n”,$Error->ErrorParameters.
); printf(“SeverityCode错误:%s\n”,$Error->SeverityCode.
); printf(“UserDisplayHint错误:%s\n”,$Error->UserDisplayHint.
); } } } 其他的 { printf($response->Ack.--易趣的官方时间是:%s\n“,$response->Timestamp->format('H:i(\G\M\T)\o\n l jS F Y'); } } 函数addProductFixedPrice() { $request=新类型\AddFixedPriceItemRequestType(); /** *使用交易服务时需要用户令牌。 * *有关获取用户令牌的更多信息,请参阅: * http://devbay.net/sdk/guides/application-keys/ */ $request->RequesterCredentials=新类型\CustomSecurityHeaderType(); $request->RequesterCredentials->eBayAuthToken=$this->TOKEN; /** *开始创建固定价格项目。 */ $item=新类型\ItemType(); /** *我们想要一份多数量的固定价格清单。 */ $item->ListingType=Enums\ListingTypeCodeType::C_FIXED_PRICE_item; $item->Quantity=99; /** *让列表每30天自动更新一次,直到取消。 */ $item->ListingDuration=Enums\ListingDurationCodeType::C\u GTC; /** *该商品的价格为19.99美元。 *请注意,我们不必指定货币,因为易趣将使用站点id *我们先前提供的,用于确定其为美元(USD)。 */ $item->StartPrice=newtypes\AmountType(数组('value'=>19.99)); /** *允许买家提交最佳报价。 */ $item->BestOfferDetails=新类型\BestOfferDetailsType(); $item->BestOfferDetails->BestOfferEnabled=true; /** *自动接受17.99美元的最佳优惠,并拒绝低于15.99美元的优惠。 */ $item->ListingDetails=新类型\ListingDetailsType(); $item->ListingDetails->BestOfferAutoAcceptPrice=新类型\AmountType(数组('value'=>17.99)); $item->ListingDetails->MinimumBestOfferPrice=new-Types\AmountType(数组('value'=>15.99)); /** *提供标题、说明和其他信息,如项目的位置。 *请注意,标题或说明中的任何HTML都必须转换为HTML实体。 */ $item->Title='H2位和bob4'; $item->Description='H1H2位和bob/h1p只是我找到的一些东西。/p'; $item->SKU='ABC-001'; $item->Country='US'; $item->Location='Beverly Hills'; $item->PostalCode='90210'; /** *这是必填字段。 */ $item->Currency='USD'; /** *显示包含该项目的图片。 */ $item->PictureDetails=新类型\PictureDetailsType(); $item->PicturedDetails->GalleryType=Enums\GalleryTypeCodeType::C_GALLERY; $item->picturedeails->PictureURL=array('https://pixabay.com/get/1d9c26b3a1355d638606/1434976441/rosa-817121_1280.jpg?direct'); /** *图书>有声读物(29792)类别中的列表项。 */ $item->PrimaryCategory=新类型\CategoryType(); $item->PrimaryCategory->CategoryID='29792'; /** *告诉买家物品的状况。 *对于我们在va中列出的类别