J
J
jekanok2016-08-30 13:46:53
LiqPay
jekanok, 2016-08-30 13:46:53

How to accept liqpay payment?

I have a problem when I make a payment on the site, the server sends me changes:

{"action":"pay","payment_id":234355738,"status":"sandbox","version":3,"type":"donate","paytype":"card","public_key":"i52889167357","acq_id":414963,"order_id":"UO3FSFRK1472553589049289","[email protected]

and I passed the dae parameter, where should be the changes that I created earlier
<?
$amaunt = $_POST['amaunt'];
$public_key = 'i528891673432432432';
    //указываем приватный ключ liqpay
    $private_key = 'Ac3Cpg*******';
    //подключаем библиотеку liqpay
    require("LiqPay.php");
    //создаем обьект класса LiqPay
    $liqpay = new LiqPay($public_key, $private_key);
    //Обращаемся к методу cnb_form указывая необходимые настройки для создания формы с кнопкой оплатить
    $data = array();

    $data['form'] = $liqpay->cnb_form(array(
        'version'       => '3',
        'amount'        => $amaunt,
        'currency'      => 'UAH',
        'description'   => 'Пополнения счёта на сумму - '.$amaunt,
        'order_id'      => $Nzakaz,
        'language'		=> 'ru',
        'type'			=> 'donate',
        'result_url'	=> 'http://likser.ru/payment/payments.php',
        'server_url'	=> 'http://likser.ru/payment/payment.php',
        'sandbox'		=> 1,
    'info' => '321',
    'dae' => 'ewogICJhaXJMaW5lIjogIkROSVBST0FWSUEiLAogICJ0aWNr
ZXROdW1iZXIiOiAiQUNTRkQxMjM1NFNBIiwKICAicGFzc2VuZ2VyTmFtZSI6ICJKb2huIERvZSIs
CiAgImZsaWdodE51bWJlciI6ICI3NDIiLAogICJvcmlnaW5DaXR5IjogIkRQIiwKICAiZGVzdGluY
XRpb25DaXR5IjogIk5ZIiwKICAiZGVwYXJ0dXJlRGF0ZSI6ICIxMDA1MTQiCn0='
    ));
echo $data['form'];
?>

pays no problem, but how can I get additional parameters?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
azait2001, 2021-11-16
@azait2001

Thanks for your code! You did everything right but did not specify the required parameter
'action' => 'pay',

S
seoman098, 2016-08-30
@seoman098

Why publicly post the keys? See Api - there is in the description where you can write additional parameters.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question