dspacelabs / ecwid
This package is abandoned and no longer maintained.
The author suggests using the dspacelabs/ecwid-client package instead.
Ecwid PHP Client
dev-master / 0.1.x-dev
2017-07-11 00:01 UTC
Requires
- dspacelabs/http-client: dev-master
- guzzlehttp/guzzle: ^6.0
- psr/log: ^1.0
Requires (Dev)
- mockery/mockery: ^0.9.9
- phing/phing: ^2.16
- phpunit/phpunit: ^6.2
This package is not auto-updated.
Last update: 2022-02-01 13:07:44 UTC
README
Ecwid PHP Client used for interacting with Ecwid's API.
Requirements
- PHP cURL Extension
- PHP >= 5.6
- dspacelabs/http-client
- dspacelabs/http-message
- Or any other PSR-7 compliant library
Installation
composer require "dspacelabs/ecwid-client:~0.1@dev"
Usage
<?php use Dspacelabs\Component\Ecwid\Client; $client = new Client($clientId, $clientSecret);
Examples
Getting Access Token
Reference: https://developers.ecwid.com/api-documentation/external-applications
use Dspacelabs\Component\Http\Message\Uri; $redirectUri = new Uri('https://www.example.com/myapp'); // @var array $response $response = $client->getAccessToken('temp_code', $redirectUri); $accessToken = $response['access_token'];
Sending Raw Requests
If you need to send a raw request and get a raw response you have access to do so. For example:
// @var \Dspacelabs\Component\Http\Message\Request $request // @var \Dspacelabs\Component\Http\Message\Response $response $response = $client->sendWithRequest($request);
The Request object MUST be PSR-7 compliant and the Response object that this client returns is PSR-7 compliant.
Sending raw requests provides the greatest flexibility, but is very low level.
Change Log
See CHANGELOG.md
License
See LICENSE