Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
Snickser committed May 14, 2024
1 parent 91fbf29 commit 31b3cb1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion 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_TEXT);
$outsumm = required_param('OutSum', PARAM_FLOAT);
$signature = required_param('SignatureValue', PARAM_ALPHANUMEXT);

if (!$robokassatx = $DB->get_record('paygw_robokassa', ['paymentid' => $invid])) {
Expand All @@ -54,9 +54,11 @@
if ($config->istestmode) {
$mrhpass2 = $config->test_password2; // Merchant test_pass2 here.
$robokassatx->success = 3;
$payment->amount = 0;
} else {
$mrhpass2 = $config->password2; // Merchant pass2 here.
$robokassatx->success = 1;
$payment->amount = $outsumm;
}

if (isset($mrhpass2)) {
Expand All @@ -65,6 +67,9 @@
die('FAIL. Signature does not match.');
}

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

// Deliver order.
helper::deliver_order($component, $paymentarea, $itemid, $paymentid, $userid);

Expand Down

0 comments on commit 31b3cb1

Please sign in to comment.