I
I
Intzet2019-12-04 23:36:34
PHP
Intzet, 2019-12-04 23:36:34

Digital signatures from the form and in the handler are not equal?

https://help.unitpay.ru/article/31-creating-paymen... It says that the digital signature that is sent to the handler:

function getFormSignature($account, $currency, $desc, $sum, $secretKey) {
    $hashStr = $account.'{up}'.$currency.'{up}'.$desc.'{up}'.$sum.'{up}'.$secretKey;
    return hash('sha256', $hashStr);
}

https://help.unitpay.ru/article/35-confirmation-payment It is already said here that a digital signature:
function getSignature($method, array $params, $secretKey) {
    ksort($params);
    unset($params['sign']);
    unset($params['signature']);
    array_push($params, $secretKey);
    array_unshift($params, $method);
    return hash('sha256', join('{up}', $params));
}

In other payments, I would just compare digital signatures. But here, in the signature generation in the handler, $method is added, which is not in the digital signature from the form on the site. They won't be exactly the same. What to do? Tell me please..

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question