V
V
Vladimir2017-01-20 03:11:45
Yii
Vladimir, 2017-01-20 03:11:45

How to process response from liqpay yii2?

Good day! With the help of LiqPay API, I made a request form and everything works well (for sending).
Here is such a controller (slightly modified for Yii2): LiqPayController
And the form itself:

$liqpay = new LiqPayController(Yii::$app->params['public_key'], Yii::$app->params['private_key']);
    echo $html = $liqpay->cnb_form([
    'action'         => 'pay',
    'amount'         => '5',
    'currency'       => 'UAH',
    'description'    => 'Описание услуги',
    'order_id'       => 'order_id_1',
    'version'        => '3',
    'sandbox'        => '1',
]);

But I can't figure out how to get a response. To be more precise, in response, I receive only two parameters using the POST method, these are data and signature. And I would like it to return more parameters. Such as, for example, payment status, payment order_id, payment amount, etc. Who implemented it, please tell me! Thanks in advance!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir, 2017-01-20
@MasterGerold

It turns out everything is very easy. You just need to write in the file receiving the answer:
base64_decode(Yii::$app->request->post('data'));

G
GrimJack, 2017-01-20
@GrimJack

Read the documentation carefully, you need to decipher these dates and signatures.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question