edfa3ly-backend/seller-center-sdk

PHP SDK for Seller Center API services

2.0.5 2019-04-14 09:13 UTC

This package is auto-updated.

Last update: 2024-10-29 05:40:42 UTC


README

Build Status codecov Software License Latest Stable Version Total Downloads

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.