Skip to content

Commit

Permalink
Merge pull request #65 from Snickser/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Snickser authored May 11, 2024
2 parents 08fd9ae + 5af7334 commit d735bfb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
5 changes: 3 additions & 2 deletions callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@

defined('MOODLE_INTERNAL') || die();

$invid = required_param('InvId', PARAM_ALPHANUMEXT);
$outsumm = required_param('OutSum', PARAM_RAW);
$invid = required_param('InvId', PARAM_INT);
$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 @@ -65,6 +65,7 @@
die('FAIL. Signature does not match.');
}

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

// Notify user.
Expand Down
9 changes: 5 additions & 4 deletions pay.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
$description = required_param('description', PARAM_TEXT);

$password = optional_param('password', null, PARAM_TEXT);
$skipmode = optional_param('skipmode', null, PARAM_TEXT);
$skipmode = optional_param('skipmode', 0, PARAM_INT);
$costself = optional_param('costself', null, PARAM_TEXT);

$config = (object) helper::get_gateway_configuration($component, $paymentarea, $itemid, 'robokassa');
Expand Down Expand Up @@ -172,11 +172,12 @@
$outsumm = $cost; // Invoice summ.

// For non-RUB pay.
$outsumcurrency = null;
$currencyarg = null;
if ($currency != 'RUB') {
$outsumcurrency = "&OutSumCurrency=$currency";
$currencyarg = ":$currency";
} else {
$outsumcurrency = null;
$currencyarg = null;
}

// Nomenclatura.
Expand All @@ -197,7 +198,7 @@

// Params.
$request = "MerchantLogin=$mrhlogin" .
"&OutSum=$outsumm$outsumcurrency" .
"&OutSum=$outsumm" . $outsumcurrency .
"&InvId=$invid" .
"&Description=" . urlencode($invdesc) .
"&SignatureValue=$crc" .
Expand Down
2 changes: 1 addition & 1 deletion return.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

require_login();

$invid = required_param('InvId', PARAM_TEXT);
$invid = required_param('InvId', PARAM_INT);

$outsumm = optional_param('OutSum', null, PARAM_TEXT);
$signature = optional_param('SignatureValue', null, PARAM_TEXT);
Expand Down

0 comments on commit d735bfb

Please sign in to comment.