webconsul / ebay-api-bundle
此包已被废弃,不再维护。没有建议的替代包。
用于 eBay API 的包装器。Symfony2 的组件包
0.2.4
2015-01-21 00:07 UTC
Requires
- php: >=5.4
- jms/serializer-bundle: ~0.13
Requires (Dev)
- phpunit/phpunit: 4.4.*
- symfony/var-dumper: 3.0.*@dev
- twig/twig: ~1.5
This package is not auto-updated.
Last update: 2022-05-16 04:09:14 UTC
README
本项目旨在创建一个围绕主要 eBay API 的简单包装器
- 购物
- 搜索
- 交易
注意:正在处理交易 API 的调用...即将推出。

API 参考(支持调用)
-
购物 API(版本 897)
- FindHalfProducts
- FindPopularItems
- FindPopularSearches
- FindProducts
- FindReviewsAndGuides
- GetCategoryInfo
- GeteBayTime
- GetItemStatus
- GetMultipleItems
- GetShippingCosts
- GetSingleItem
- GetUserProfile
-
搜索 API(版本 1.13.0)
- findCompletedItems
- findItemsAdvanced
- findItemsByCategory
- findItemsByImage 注意:暂时不支持!
- findItemsByKeywords
- findItemsByProduct
- findItemsIneBayStores
- getHistograms
- getSearchKeywordsRecommendation
- getVersion
-
交易 API(版本 903)
- GetCategories
- 注意:其他调用正在进行中...
简单示例
(在控制器中)
$api = 'Shopping'; $callName = 'GetSingleItem'; $ebay = $this->get('web_consul_ebay_api.main'); $call = $ebay->getInstance('Shopping', 'GetSingleItem', $ebay::MODE_PRODUCT); $variationSpecifics = []; $nameValueList = new NameValueList(); $nameValueList->setName('Colour')->setValue(['RED']); $variationSpecifics[] = $nameValueList; // set Call-specific and Standard Input Fields $call ->setItemID(151551119370) ->setIncludeSelector('Details, Variations') ->setVariationSpecifics($variationSpecifics); // get response in XML format $service = $this->get('web_consul_ebay_api.make_call'); $output = $service->getResponse($call);
通常,请求属性通过标准设置器设置。对于更复杂的结构和容器,创建特殊类型
- WebConsul\EbayApiBundle\Type
- Affiliate
- AspectFilter
- ItemFilter
- NameValueList
- PaginationInput
- ProductID
- RequesterCredentials
完整文档将存储在 Resources/doc/index.md
安装
步骤 1:使用 composer 下载 EbayApiBundle
在您的 composer.json 中添加 EbayApiBundle
{ "require": { "webconsul/ebay-api-bundle": "dev-master" } }
步骤 2:更新 composer
$ php composer.phar update webconsul/ebay-api-bundle
步骤 3:启用组件包
<?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new WebConsul\EbayApiBundle\WebConsulEbayApiBundle(), ); }
步骤 4:启用 JMS Serializer
此组件需要JMS Serializer才能正确工作。因此,您需要注册它
<?php // app/AppKernel.php public function registerBundles() { // ... new JMS\SerializerBundle\JMSSerializerBundle(), // ... ); }
第4步:配置
出于安全考虑,组件的所有配置参数都必须添加到parameters.yml
parameters:
...
web_consul_ebay_api:
auth_token: 'YOUR TOKEN FOR TESTING API CALLS'
application_keys:
sandbox:
dev_id: '...'
app_id: '...'
cert_id: '...'
production:
dev_id: '...'
app_id: '...'
cert_id: '...'
您可以在[ eBay 开发者计划]的账户页面找到这些参数的值(https://developer.ebay.com/DevZone/account/Default.aspx)
所有安装说明都位于文档中。
API调用示例
如果您想查看所有支持的API调用的示例,您可以配置EbayApiBundle中的CallController
。
第1步:路由
// app/config/routing.yml web_consul_ebay_api_homepage: resource: "@WebConsulEbayApiBundle/Controller/" type: annotation
第2步:浏览
在浏览器中打开:http://YOUR_HOST/callReference
。
在该页面上,您可以查看支持的API调用的完整列表。
许可证
此组件受MIT许可证的约束。请参阅组件中的完整许可证。
Resources/meta/LICENSE
报告问题或功能请求
问题和功能请求在Github问题跟踪器中跟踪。