PHP code example of alexmg86 / laravel-goodsru

1. Go to this page and download the library: Download alexmg86/laravel-goodsru 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/ */

    

alexmg86 / laravel-goodsru example snippets


php artisan vendor:publish --provider="Alexmg86\LaravelGoodsru\ServiceProvider"

use Alexmg86\LaravelGoodsru\LaravelGoodsru;

$api = new LaravelGoodsru();

$api = new LaravelGoodsru($shipmentId, $orderCode);

$api = new LaravelGoodsru();
$api->initOrder($shipmentId, $orderCode);

$api = new LaravelGoodsru();
$api->setOrder($orderCode);
$api->setShipment($shipmentId);

$api = new LaravelGoodsru();
$data = $api->get($shipmentId);
$data = $api->get([$shipmentId1, $shipmentId2]);

$api = new LaravelGoodsru();
$api->setShipment($shipmentId);
$data = $api->confirm([1 => 1111, 2 => 2222]);

$api = new LaravelGoodsru();
$api->setShipment($shipmentId);
$data = $api->reject([1 => 1111, 2 => 2222], $reason);

$reasons = $api->getReasons();

$api = new LaravelGoodsru();
$api->initOrder($shipmentId, $orderCode);
$data = $api->packing([1 => 1, 2 => 1]);

$api = new LaravelGoodsru();
$api->setShipment($shipmentId);
$data = $api->print([1, 2]);

$api = new LaravelGoodsru();
$api->setShipment($shipmentId);
// формат YYYY-MM-DDThh:mm:ss+hh:mm
$api->setShippingDate($shippingDate);
$data = $api->shipping([1, 2]);

$api = new LaravelGoodsru();
$data = $api->search($period, $statuses);

$api->getStatuses();

$api->setOrder($orderCode);
// формат YYYY-MM-DDThh:mm:ss+hh:mm
$api->setShippingDate($shippingDate);

$api->setCount(200);

$api->getConfig();

$api->getCount();
$api->setCount(200);

$api->getDiscount();

$api->getOrder();
$api->setOrder($orderCode);

$api->getMerchantId();

$api->getMerchantName();

$api->getReasons();

$api->getCanceles();

$api->getStatuses();

$api->getShipment();
$api->setShipment($shipmentId);

$api->setShippingDate($shippingDate);