V
V
Vladimir2017-01-16 20:06:38
Yii
Vladimir, 2017-01-16 20:06:38

How to accept a response from liqpay?

Good day! Created a company on liqpay. In the API settings in the "URL of the store client-server:" I entered the address of the site where this data should simply be displayed via print_r (). In the Checkout/API section, I checked the autoredirect and post date checkboxes. I create a test button and put the form on the site. After the transition, I fill out the form and click the "Pay" button. Then the redirect is triggered and the browser tells me that I am trying to transfer data over an insecure channel, and when I click "Continue" I am redirected to the site but there is a Bad Request (# 400). Tell me what's the problem? As far as I understand this is a problem in _csrf but I don't know what to do. Can you please tell me what to do in this situation?
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2017-01-17
@MasterGerold

Bad Request (#400) - as I understand it, yii2 issues. Then the problem is in _csrf. Solutions 2:
1. pass _csrf with the form
2. disable validation in the action that the request is knocking on or in the entire controller, like this:

public function beforeAction($action)
  {
    $this->enableCsrfValidation = false;
    return parent :: beforeAction($action);
  }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question