/yii2-vk-market

Yii2 market server for vk.com applications which processes payment notifications.

Primary LanguagePHPGNU General Public License v3.0GPL-3.0

Yii2 VK market

Description

This is a market server for vk.com applications which processes payment notifications.

Configuration

Basic configuration

Application credentials

Set application credentials in app\configurations\parameters\parameters.php.

return [
    'application-id' => 42,
    'application-secret' => 'fourty-two',
];

Database connection

Configure database connection options in app\configurations\database\database.php.

return [
    'class' => 'yii\db\Connection',
    'dsn' => 'pgsql: host=localhost; dbname=market;',
    'username' => 'username',
    'password' => 'password',
    'charset' => 'utf8',
];

Database schema

Above configuration is sufficient for the minimal working example if database schema corresponds the default models implementation. You can inspect default models for further information: DatabaseClient, DatabaseOrder and DatabaseProduct.

Event listeners

Both request types have their event listeners. You should place your application logic inside them:

Extended configuration

Custom models and proxies

You are free to implement custom models and proxies for your application. Three models and three corresponding proxies are required for the application to work correctly. You must implement the following interfaces:

After implementing custom proxies you must specify them in corresponding configuration files:

Custom listeners

You can also implement your custom event listeners. They will allow you to perform arbitrary actions before and after client requests. Listeners must implement the following interfaces:

After implementing custom listeners you must specify them in corresponding configuration files: