M
M
Max2020-02-28 01:35:14
PHP
Max, 2020-02-28 01:35:14

How to get liqpay payment status via php?

There was a problem.
The person using the payment link fills in the amount and pays. Through callback I can get two POST parameters - data and signature. How to extract payment data from them? For example, I need to find out the amount that a person paid. The documentation is not clear at all. If possible, please post an example.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
MaLuTkA_UA, 2020-03-05
@sshahmax

Read the liqpay documentation normally, everything is perfectly described there. In the callback you get data and signature, data is an array with information about the payment in base64 format, therefore, first you do a signature check, for this you need to read it

$sign = base64_encode( sha1( 
$private_key .  
$data . 
$private_key 
, 1 ));

And compare if your sign is equal to the received signature, then the request is valid.
Here is the link to the doc

D
Dimonchik, 2020-03-01
@dimonchik2013

if possible, ask support

M
Max, 2020-04-17
@sshahmax

I already understood. I just needed to decode base64 and everything is fine.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question