frontend/controllers/ResellerController.php
/**
     * Renders pay voucher page
     *
     * @param  integer $id voucher id
     * @return mixeds
     */
Renders pay voucher page
@param  integer $id voucher id
@return mixeds
Renders pay voucher page @param integer $id voucher id @return mixeds
public function actionPayVoucher($id)
    {
        $user = Yii::$app->user->identity;
        $voucher = Voucher::find()
            ->where(['id' => $id])
            ->andWhere(['issuer_id' => $user->id])
            ->andWhere(['<>', 'status', Voucher::STATUS_SUSPENDED])
            ->andWhere(['is_payed' => 0])
            ->one();
        if ($voucher == null) {
            throw new NotFoundHttpException();
        }
        $fee = ResellerFee::findByUser($user);
        $pageRepo = Yii::$container->get('common\repositories\PagesRepository');
        $pageMeta = $pageRepo->getPageMetaData('reseller-pay-voucher');
        $pageTitle = $pageRepo->getPageTitle('reseller-pay-voucher');
        $this->layout = 'reseller';
        return $this->render('payVoucher', [
            'meta' => $pageMeta,
            'title' => $pageTitle,
            'voucher' => $voucher,
            'fee' => $fee
        ]);
    }
public function actionPayVoucher ( $ id ) { $ user = Yii :: $ app -> user -> identity ; $ voucher = Voucher :: find ( ) -> where ( [ 'id' => $ id ] ) -> andWhere ( [ 'issuer_id' => $ user -> id ] ) -> andWhere ( [ '<>' , 'status' , Voucher :: STATUS_SUSPENDED ] ) -> andWhere ( [ 'is_payed' => 0 ] ) -> one ( ) ; if ( $ voucher == null ) { throw new NotFoundHttpException ( ) ; } $ fee = ResellerFee :: findByUser ( $ user ) ; $ pageRepo = Yii :: $ container -> get ( 'common\repositories\PagesRepository' ) ; $ pageMeta = $ pageRepo -> getPageMetaData ( 'reseller-pay-voucher' ) ; $ pageTitle = $ pageRepo -> getPageTitle ( 'reseller-pay-voucher' ) ; $ this -> layout = 'reseller' ; return $ this -> render ( 'payVoucher' , [ 'meta' => $ pageMeta , 'title' => $ pageTitle , 'voucher' => $ voucher , 'fee' => $ fee ] ) ; }
Renders pay voucher page
 @param  integer $id voucher id
 @return mixeds
Renders pay voucher page @param integer $id voucher id @return mixeds