src/controllers/YandexKassaController.php
public function actionBillForm()
    {
        if (!$code = \Yii::$app->request->get('code')) {
            throw new Exception('Order not found');
        }

        if (!$bill = ShopBill::find()->where(['code' => $code])->one()) {
            throw new Exception('Order not found');
        }

        /*return $this->render($this->action->id, [
            'model' => $bill,
        ]);*/


        /* @var $yandexKassa \skeeks\cms\shop\paySystems\YandexKassaPaySystem */
        /* @var $model \skeeks\cms\shop\models\ShopBill */

        $model = $bill;
        $yandexKassa = $model->shopPaySystem->paySystemHandler;
        $money = $model->money->convertToCurrency("RUB");
        $returnUrl = $model->getUrl(true);

        $client = new Client();
        $client->setAuth($yandexKassa->shop_id, $yandexKassa->shop_password);
        $payment = $client->createPayment(
            array(
                'amount' => array(
                    'value' => $money->amount,
                    'currency' => 'RUB',
                ),
                'confirmation' => array(
                    'type' => 'redirect',
                    'return_url' => $returnUrl,
                ),
                'description' => 'Заказ №' . $model->shop_order_id,
            ),
            uniqid('', true)
        );

        \Yii::info(print_r($payment, true), self::class);

        if (!$payment->id) {
            throw new Exception('Yandex kassa payment id not found');
        }

        $model->external_data = [
            'id' => $payment->id
        ];
        $model->save();



        /*$paymentId = $payment->id;
        $idempotenceKey = uniqid('', true);
        $response = $client->capturePayment(
          array(
              'amount' => array(
                  'value' => '2.00',
                  'currency' => 'RUB',
              ),
          ),
          $paymentId,
          $idempotenceKey
        );*/

        return $this->redirect($payment->confirmation->getConfirmationUrl());
    }
public function actionBillForm()
    {
        if (!$code = \Yii::$app->request->get('code')) {
            throw new Exception('Order not found');
        }

        if (!$bill = ShopBill::find()->where(['code' => $code])->one()) {
            throw new Exception('Order not found');
        }

        /*return $this->render($this->action->id, [
            'model' => $bill,
        ]);*/


        /* @var $yandexKassa \skeeks\cms\shop\paySystems\YandexKassaPaySystem */
        /* @var $model \skeeks\cms\shop\models\ShopBill */

        $model = $bill;
        $yandexKassa = $model->shopPaySystem->paySystemHandler;
        $money = $model->money->convertToCurrency("RUB");
        $returnUrl = $model->getUrl(true);

        $client = new Client();
        $client->setAuth($yandexKassa->shop_id, $yandexKassa->shop_password);
        $payment = $client->createPayment(
            array(
                'amount' => array(
                    'value' => $money->amount,
                    'currency' => 'RUB',
                ),
                'confirmation' => array(
                    'type' => 'redirect',
                    'return_url' => $returnUrl,
                ),
                'description' => 'Заказ №' . $model->shop_order_id,
            ),
            uniqid('', true)
        );

        \Yii::info(print_r($payment, true), self::class);

        if (!$payment->id) {
            throw new Exception('Yandex kassa payment id not found');
        }

        $model->external_data = [
            'id' => $payment->id
        ];
        $model->save();



        /*$paymentId = $payment->id;
        $idempotenceKey = uniqid('', true);
        $response = $client->capturePayment(
          array(
              'amount' => array(
                  'value' => '2.00',
                  'currency' => 'RUB',
              ),
          ),
          $paymentId,
          $idempotenceKey
        );*/

        return $this->redirect($payment->confirmation->getConfirmationUrl());
    }
Payment form

@throws Exception