1. Go to this page and download the library: Download ux2dev/speedy library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ux2dev / speedy example snippets
use GuzzleHttp\Client;
use GuzzleHttp\Psr7\HttpFactory;
use Ux2Dev\Speedy\Config\SpeedyConfig;
use Ux2Dev\Speedy\Speedy;
use Ux2Dev\Speedy\Dto\Request\Shipment\CreateShipmentRequest;
$config = new SpeedyConfig(
userName: 'your-username',
password: 'your-password',
language: 'EN',
);
$factory = new HttpFactory();
$speedy = new Speedy($config, new Client(), $factory, $factory);
$response = $speedy->shipment()->create(new CreateShipmentRequest(
ref1: 'ORDER-1234',
));
echo $response->id;
use Ux2Dev\Speedy\Laravel\Facades\Speedy;
use Ux2Dev\Speedy\Dto\Request\Shipment\CreateShipmentRequest;
$response = Speedy::shipment()->create(new CreateShipmentRequest(ref1: 'ORDER-1234'));