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 31b3cb1 commit f44d72d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
8 changes: 6 additions & 2 deletions callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@
} else {
$mrhpass2 = $config->password2; // Merchant pass2 here.
$robokassatx->success = 1;
$payment->amount = $outsumm;
// For currency conversion.
if ($payment->currency != 'RUB') {
$payment->currency = 'RUB';
$payment->amount = $outsumm;
}
}

if (isset($mrhpass2)) {
Expand All @@ -82,7 +86,7 @@
'Success completed'
);

// Write to DB.
// Update paygw.
if (!$DB->update_record('paygw_robokassa', $robokassatx)) {
die('FAIL. Update db error.');
} else {
Expand Down
2 changes: 1 addition & 1 deletion lang/ru/paygw_robokassa.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,5 @@

$string['messagesubject'] = 'Уведомление о платеже';
$string['message_success_completed'] = 'Здравствуйте, {$a->firstname}!
Ваша платёжная транзакция номер {$a->orderid} на {$a->fee} {$a->currency} успешно завершена. Спасибо за ваше пожертвование.
Ваша платёжная транзакция {$a->orderid} на {$a->fee} {$a->currency} успешно завершена. Спасибо за ваше пожертвование.
Если элемент курса недоступен, обратитесь в техподдержку сайта.';
3 changes: 2 additions & 1 deletion pay.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
$paymentarea,
$itemid,
$userid,
$cost,
0,
$payable->get_currency(),
'robokassa'
);
Expand All @@ -189,6 +189,7 @@
$xmlresponse = $curl->get($location, $options);
$response = xmlize($xmlresponse, $whitespace = 1, $encoding = 'UTF-8', $reporterrors = true);
$err = $response['OperationStateResponse']['#']['Result'][0]['#']['Code'][0]['#'];
$err = $response['OperationStateResponse']['#']['Result'][0]['#']['Code'][0]['#'];
if ($err != 3) {
$DB->delete_records('paygw_robokassa', ['id' => $transactionid]);
redirect($url, get_string('payment_error', 'paygw_cryptocloud') . " (Invoice ID check error $err)", 0, 'error');
Expand Down

0 comments on commit f44d72d

Please sign in to comment.