public function actionGetPaymentMethodInfo($id) {

        if (\Yii::$app->request->isAjax) {
            if (!empty($id)) {

                $method = PaymentMethod::findOne($id);
                $methodTranslation = $method->translation;

                $method = ArrayHelper::toArray($method);
                $method['translation'] = ArrayHelper::toArray($methodTranslation);
                $method['image'] = '/images/payment/' .
                    FileHelper::getFullName(
                        \Yii::$app->shop_imagable->get('payment', 'small', $method['image']
                        ));
                return json_encode([
                    'paymentMethod' => $method,
                ]);
            }
        }
        throw new NotFoundHttpException();
    }
public function actionGetPaymentMethodInfo($id) {

        if (\Yii::$app->request->isAjax) {
            if (!empty($id)) {

                $method = PaymentMethod::findOne($id);
                $methodTranslation = $method->translation;

                $method = ArrayHelper::toArray($method);
                $method['translation'] = ArrayHelper::toArray($methodTranslation);
                $method['image'] = '/images/payment/' .
                    FileHelper::getFullName(
                        \Yii::$app->shop_imagable->get('payment', 'small', $method['image']
                        ));
                return json_encode([
                    'paymentMethod' => $method,
                ]);
            }
        }
        throw new NotFoundHttpException();
    }
public function actionGetPaymentMethodInfo ( $ id ) { if ( \ Yii :: $ app -> request -> isAjax ) { if ( ! empty ( $ id ) ) { $ method = PaymentMethod :: findOne ( $ id ) ; $ methodTranslation = $ method -> translation ; $ method = ArrayHelper :: toArray ( $ method ) ; $ method [ 'translation' ] = ArrayHelper :: toArray ( $ methodTranslation ) ; $ method [ 'image' ] = '/images/payment/' . FileHelper :: getFullName ( \ Yii :: $ app -> shop_imagable -> get ( 'payment' , 'small' , $ method [ 'image' ] ) ) ; return json_encode ( [ 'paymentMethod' => $ method , ] ) ; } } throw new NotFoundHttpException ( ) ; }
Returns payment method model if request is Ajax.

@param integer $id
@return PaymentMethod
@throws NotFoundHttpException
Returns payment method model if request is Ajax .