E
E
evilelf2015-11-28 19:35:50
Yii
evilelf, 2015-11-28 19:35:50

How to fix error when integrating OkPay in yii?

Given: Yii 1.0.16
Payment system OKPAY
Data comes to notification URL
In the IPN history, there are only notifications "The remote server returned an error: (401) Unauthorized"
How to fix?
$_POST array is empty

'request'=>array(
                'class' => 'HttpRequest',
                'enableCookieValidation'=>true,
                'enableCsrfValidation'=>true,
                'enableLanguage'=>true,
            ),

But in HttpRequest inherited validateCsrfToken I check the path and do Yii::app()->request->enableCsrfValidation=false;it, but it doesn't help.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
A1eksandr, 2015-11-28
@A1eksandr

log all inputs (post, get, server, headers) that come into the controller. In yii2, for these purposes, I overridden the method

public function beforeAction($action){
}

Maybe in your case it doesn’t even reach the controller and for some reason it is blocked at the web server level, sort it out step by step.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question