Answer the question
In order to leave comments, you need to log in
How to pass a parameter in PHP?
There is a method in the api.php file that looks like this:
public function cnb_form($params)
{
$language = 'ru';
if (isset($params['language']) && $params['language'] == 'en') {
$language = 'en';
}
$params = $this->cnb_params($params);
$data = base64_encode( json_encode($params) );
$signature = $this->cnb_signature($params);
return sprintf('
<form method="POST" action="%s" accept-charset="utf-8">
<input type="text" name="price">
%s
%s
<input type="submit">
</form>
',
$this->_checkout_url,
sprintf('<input type="hidden" name="%s" value="%s" />', 'data', $data),
sprintf('<input type="hidden" name="%s" value="%s" />', 'signature', $signature),
$language
);
}
function addbalance(){
require("api.php");
$micro = sprintf("%06d",(microtime(true) - floor(microtime(true))) * 1000000);
$number = date("YmdHis");
$order_id = $number.$micro;
$merchant_id= "****";
$signature="****";
$desc = $_GET[‘desc’];
$order_id = $_GET[‘order_id’];
$price = $_POST['price'];
$liqpay = new LiqPay($merchant_id, $signature, $price);
$html = $liqpay->cnb_form(array(
'version' => '3',
'amount' => $price,
'currency' => 'UAH',
'description' => "Пополнение баланса",
'order_id' => $order_id
));
echo $html;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question