PHP code example of abdulloh-id / measoft-delivery-php

1. Go to this page and download the library: Download abdulloh-id/measoft-delivery-php 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/ */

    

abdulloh-id / measoft-delivery-php example snippets


use AbdullohId\MeasoftDelivery\MeasoftClient;

MeasoftClient::configure(
    login: 'your_login',
    password: 'your_password',
    extra: 123
);

use AbdullohId\MeasoftDelivery\MeasoftSync;
use AbdullohId\MeasoftDelivery\Repositories\PdoMeasoftRepository;

$pdo = new PDO('mysql:host=127.0.0.1;dbname=your_db;charset=utf8mb4', 'root', '');
$sync = new MeasoftSync(new PdoMeasoftRepository($pdo));

// Sync regions & towns
$towns = MeasoftSync::getTownList();
$sync->updateRegionList($towns);
$sync->updateTownList($towns);

// Sync pickup points (PVZ)
$pvzList = MeasoftSync::getPvzList();
$sync->updatePvzList($pvzList);
bash
php examples/run_measoft_sync.php
bash
php examples/run_measoft_sync.php --host=127.0.0.1 --dbname=my_db --user=root --pass=secret