filipsedivy/dropshippingcz

Dropshipping.cz - PHP client

0.2 2018-09-01 13:08 UTC

This package is auto-updated.

Last update: 2020-03-27 05:30:16 UTC


README

Dropshipping

Introduction

This is a library that maps the Dropshipping.cz API.

Installation

The recommended way to is via Composer:

composer require filipsedivy/dropshippingcz

It requires PHP version 7.1 and supports PHP up to 7.2.

Usage

$apiConfig = new FilipSedivy\DropshippingCz\Model\ApiConfig('token');
$client = new FilipSedivy\DropshippingCz\Client($apiConfig);

Services

All services are located in the src/Services folder

$client->getEshops()
$client->getProducts()
$client->getPayments()
$client->getDeliveries()
$client->getOrder()
$client->getOrders()

Object HttpResponse

HttpResponse is an object that takes care of returning data from the API. Allows:

  • Creating collections and entities over data
  • Working with raw data
  • Convert to array

List of methods object HttpResponse

Method Data type of return data Description
getResponse() ResponseInterface This is the returned data object from the Guzzle library
getContent() string Raw body from API
toArray(int $options = 0) mixed (object OR array) Convert JSON output to array
toArrayData() mixed (object OR array) Convert only data to array
toCollection() IEntity[] Converting data to collections and entities serves to better work with data

Example

Get list of eshops

$arrayList = $client->getEshops()->getList()->toArray();
$collection = $client->getEshops()->getList()->toCollection();

TODO

  • HttpResponse
    • MultiLevel mapper / create sub entity, collection
    • Map POST response
  • Services/Orders
    • Complete sendOrder(...) method
  • Entity/Services/...
    • Complete PHPDoc
    • Create entity annotation
    • Strict data types
    • Complete IEntity->toArray() method :(

Donate

Has a library helped you or made your job easier? I will be happy if you contribute PR or even financially. Thanks to these posts, this library can grow and ease work.

PayPal (link to PayPal.me )
mail@filipsedivy.cz