src/controllers/OrderController.php
public function actionPay()
    {
        /**
         * @var $shopOrder ShopOrder
         */
        if (\Yii::$app->request->get('code')) {
            $shopOrder = ShopOrder::find()->where(['code' => \Yii::$app->request->get('code')])->one();
        } else {
            $shopOrder = ShopOrder::findOne(\Yii::$app->request->get('id'));
        }

        if (!$shopOrder) {
            throw new NotFoundHttpException;
        }

        $shopBill = new ShopBill();
        $shopBill->shop_order_id = $shopOrder->id;
        $shopBill->shop_buyer_id = $shopOrder->shop_buyer_id;
        $shopBill->shop_pay_system_id = $shopOrder->shop_pay_system_id;
        $shopBill->amount = $shopOrder->amount;
        $shopBill->currency_code = $shopOrder->currency_code;
        $shopBill->description = "Оплата по заказу №".$shopOrder->id;
        if (!$shopBill->save()) {
            throw new UserException('Не создался счет: '.print_r($shopBill->errors, true));
        }

        return $shopBill->shopPaySystem->paySystemHandler->actionPaymentResponse($shopBill);

    }
public function actionPay()
    {
        /**
         * @var $shopOrder ShopOrder
         */
        if (\Yii::$app->request->get('code')) {
            $shopOrder = ShopOrder::find()->where(['code' => \Yii::$app->request->get('code')])->one();
        } else {
            $shopOrder = ShopOrder::findOne(\Yii::$app->request->get('id'));
        }

        if (!$shopOrder) {
            throw new NotFoundHttpException;
        }

        $shopBill = new ShopBill();
        $shopBill->shop_order_id = $shopOrder->id;
        $shopBill->shop_buyer_id = $shopOrder->shop_buyer_id;
        $shopBill->shop_pay_system_id = $shopOrder->shop_pay_system_id;
        $shopBill->amount = $shopOrder->amount;
        $shopBill->currency_code = $shopOrder->currency_code;
        $shopBill->description = "Оплата по заказу №".$shopOrder->id;
        if (!$shopBill->save()) {
            throw new UserException('Не создался счет: '.print_r($shopBill->errors, true));
        }

        return $shopBill->shopPaySystem->paySystemHandler->actionPaymentResponse($shopBill);

    }
Оплатить

@return mixed
@throws NotFoundHttpException