edfa3ly-backend / seller-center-sdk
PHP SDK for Seller Center API services
2.0.5
2019-04-14 09:13 UTC
Requires
- php: >=7.1.3
- ext-dom: *
- ext-json: *
- illuminate/support: *
- psr/log: ^1.1
- symfony/dependency-injection: 4.2.*
- symfony/http-foundation: ^4.2
- symfony/twig-bundle: 4.2.*
- symfony/validator: ^4.2
Requires (Dev)
- guzzlehttp/guzzle: ^6.3
- mockery/mockery: ^1.2
- symfony/phpunit-bridge: *
README
Install
Via Composer
$ composer require edfa3ly-backend/seller-center-sdk
Dependency Injection (Symfony 4)
Make sure to register the SellerCenterBundle::class
to use dependency injection.
Seller Center Docs
https://sellerapi.sellercenter.net/docs
Available Actions
- Category Attributes
getCategoryAttributes
- Feed
getFeedStatus
- Order
cancelOrder
getMultipleOrderItems
getMultipleOrdersWithOrderItems
getOrder
getOrderItems
getOrderWithOrderItems
getOrders
setOrderStatusToDelivered
setOrderStatusToFailedDelivery
setOrderStatusToReadyToShip
setOrderStatusToShipped
- Product
createProducts
getProducts
updateProducts
- Product Image
createImages
Usage
class Example
{
public function index() {
$configuration = new Configuration('https://sellercenter-api.x.com.y','email@example.com','apiKey','apiPassword','username','v1');
$configuration->setMinAttemptsDelay(1); // in seconds default : 1
$configuration->setMaxAttemptsDelay(10); // in seconds default : 5
$configuration->setRequestAttemptsThreshold(15) ; // number of failure retries default : 10
$productService = new ProductService();
$products = $productService->getProducts($configuration,[]);
}
}
Rendering Support
When performing one of the following actions :
createProducts
updateProducts
createImages
You will need xml representation to be delivered to the service ,
Now you can use the Renderer
Service provided by this package .
class Example
{
public function index() {
$configuration = new Configuration('https://sellercenter-api.x.com.y','email@example.com','apiKey','apiPassword','username','v1');
$configuration->setMinAttemptsDelay(1); // in seconds default : 1
$configuration->setMaxAttemptsDelay(10); // in seconds default : 5
$configuration->setRequestAttemptsThreshold(15) ; // number of failure retries default : 10
$productService = new ProductService();
$products = $productService->getProducts($configuration,[]);
$renderer = new ProductUpdateRenderer();
$xml = $renderer->render($products);
$productService->updateProducts($configuration,$xml);
}
}
Logging Support
Set Configuration to enable logging
$configuration->setLoggingEnabled(true);
How to test
$ make test
Security
If you discover any security related issues, please email omarfawzi96@gmail.com instead of using the issue tracker.
License
The MIT License (MIT). Please see License File for more information.