G
G
gryga2020-10-08 23:16:53
PHP
gryga, 2020-10-08 23:16:53

LiqPay why Wrong request signature?

I dont understand PHP in
general
:
$data_arr = array("public_key" => "public_key","version" => "3","action" => $period_val,"amount" => $summ,"currency" => "UAH","description" => $description,"order_id" => uniqid() );

$data = base64_encode(json_encode($data_arr));

$sign_string = 'secret_key'.$data.'secret_key';

$signature = base64_encode( sha1( $sign_string) );

header('Content-type: application/json');

$rtn_data_json = json_encode(array("data" => $data, "signature" => $signature,'json_string' => $data_arr));
echo $rtn_data_json;
wp_die();

I noticed that the signature itself is too big.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
gryga, 2020-10-08
@gryga

$signature = base64_encode( sha1( $sign_string, true ) );

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question