Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Snickser committed May 18, 2024
1 parent c06b163 commit ce1d190
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
defined('MOODLE_INTERNAL') || die();

$invid = required_param('InvId', PARAM_INT);
$outsumm = required_param('OutSum', PARAM_FLOAT);
$outsumm = required_param('OutSum', PARAM_TEXT);
$signature = required_param('SignatureValue', PARAM_ALPHANUMEXT);

if (!$robokassatx = $DB->get_record('paygw_robokassa', ['paymentid' => $invid])) {
Expand Down Expand Up @@ -59,18 +59,18 @@
$robokassatx->success = 1;
}

// For currency conversion.
$payment->amount = $outsumm;
if ($payment->currency !== 'RUB') {
$payment->currency = 'RUB';
}

if (isset($mrhpass2)) {
$crc = strtoupper(md5("$outsumm:$invid:$mrhpass2"));
if ($signature !== $crc) {
die('FAIL. Signature does not match.');
}

// For currency conversion.
$payment->amount = $outsumm;
if ($payment->currency !== 'RUB') {
$payment->currency = 'RUB';
}

// Update payment.
$DB->update_record('payments', $payment);

Expand Down

0 comments on commit ce1d190

Please sign in to comment.