1. Go to this page and download the library: Download tecsin/yii2-voguepay 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/ */
namespace app\controllers;
class SiteController extends \yii\web\Controller
{
//...
public function actions()
{
return [
//...
'voguepay-notification' => [
'class' => 'tecsin\pay2\actions\Pay2NotificationAction', // see this class if you will change anything for better explanations
'modelClass' => 'tecsin\pay2\models\NotificationExample'//this is the default model to run for every notification
'method' => 'voguepay'//the method to be called in modelClass, and must have a parameter which should be an array of transaction from voguepay
],
'set-data' => [
'class' => 'tecsin\pay2\actions\InitSaleAction', //redirects user to voguepay payment page after saving the pay now form data to db
//this is mandatory if you use the PayButton widget
],
];
}
}