grozzzny / westgate
Westgate component for yii2 - westgate.market
dev-master
2020-03-23 15:30 UTC
Requires
- yiisoft/yii2: *
- yiisoft/yii2-httpclient: ~2.0.0
This package is auto-updated.
Last update: 2026-02-24 02:51:34 UTC
README
Installation guide
$ php composer.phar require grozzzny/westgate "dev-master"
Get token
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();