grozzzny/westgate

Westgate component for yii2 - westgate.market

Installs: 53

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:yii2-extension

dev-master 2020-03-23 15:30 UTC

This package is auto-updated.

Last update: 2024-04-23 23:02:27 UTC


README

Installation guide

$ php composer.phar require grozzzny/westgate "dev-master"

Get token

http://goods.tpzk.ru

Set config and token

\config\web.php

$config = [
    ...
    'components' => [
        ...
        'westgate' => [
            'class' => 'grozzzny\westgate\WestgateComponent',
            'token' => 'qwertyuiop1234567890',
            //'itemObject' => 'main\models\ItemObject',
            //'categoryObject' => 'main\models\CategoryObject',
            //'orderObject' => 'main\models\OrderObject',
        ],
        ...
    ],
    ...
];

return $config;

Examples

List items:

$client = Yii::$app->westgate->itemIndexClient
    ->category($slug)
    ->search($search);
$provider = new WestgateDataProvider(['client' => $client]);

View orders:

$client = Yii::$app->westgate->orderIndexClient->user(['email' => Yii::$app->user->identity->email]);
$provider = new WestgateDataProvider(['client' => $client]);

Get inn:

$inn = Yii::$app->westgate->passportInnClient
    ->passportParams($fio, $birthdate, $docnum, $docdt, $dcode)
    ->send();