S
S
Sergey2015-04-21 12:59:26
Yii
Sergey, 2015-04-21 12:59:26

How to receive data from interkassa on Yii2?

I sent a request to the interkassa, received a response, but I don’t know how to accept and save the data in MySQL.
Removed CSRF validation.

public function actionCreate()
    {
        $model = new Activation();
        
        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(['view', 'id' => $model->active_id]);
        } else {
            return $this->render('create', [
                'model' => $model,
            ]);
        }
    }

Testing for payment failure:
public function actionFail()
    {
        $enableCsrfValidation = false;
        $model = new Activation();
        return $this->render('fail', [
                'model' => $model,
         ]);
    }

_form.php
<?php $form = ActiveForm::begin([
        'method' => 'post',
        'action' => 'https://sci.interkassa.com/#/paysystem/test',
    ]); ?>
    <?= Html::activeTextInput($model, 'ik_co_id', [ 'name' => 'ik_co_id','value' => '11111111111']) ?>

    <?= Html::activeTextInput($model, 'ik_pm_no', [ 'name' => 'ik_pm_no','value' => '11111']) ?>

    <?= Html::activeTextInput($model, 'ik_am', [ 'name' => 'ik_am','value' => '100']) ?>

    <?= Html::activeTextInput($model, 'ik_cur', [ 'name' => 'ik_cur','value' => 'USD']) ?>
    
    <?= Html::activeTextInput($model, 'ik_desc', [ 'name' => 'ik_desc','value' => 'Description']) ?>

fail.php is still clean

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Dialog, 2015-04-21
@Dialog

See the documentation of the interkassa and integration examples, you have an internal account number in your store, it is either ik_pm_no or ik_co_id, you can use them to pull data from MySQL when receiving a response from the interkassa.

S
Sergey, 2015-04-21
@alekskondr

That's understandable. In general, how to get data from the interkassa? And here is the documentation of the interkassa, I looked through it all? Here the problem is in the framework, how to receive data in general?

3
3ton, 2015-04-22
@3ton

$model->load(Yii::$app->request->post())
Everything seems to be available
here POST data is passed to the model's load() method Yii::$app->request->post()
You don't receive POST data or what is the actual problem???

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question