Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Snickser committed Dec 13, 2024
1 parent 2f53376 commit c6240e1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
6 changes: 6 additions & 0 deletions lang/en/paygw_robokassa.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,9 @@
Please send me some <a href="https://yoomoney.ru/fundraise/143H2JO3LLE.240720">donate</a>😊</div>
<iframe src="https://yoomoney.ru/quickpay/fundraise/button?billNumber=143H2JO3LLE.240720"
width="330" height="50" frameborder="0" allowtransparency="true" scrolling="no"></iframe>';

$string['error_txdatabase'] = 'Error write TX data to database';
$string['error_notvalidtxid'] = 'FAIL. Not a valid transaction id';
$string['error_notvalidpayment'] = 'FAIL. Not a valid payment';
$string['error_notvalidsignature'] = 'FAIL. Not a valid signature';

2 changes: 2 additions & 0 deletions lang/ru/paygw_robokassa.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,5 @@
Пожалуйста, отправьте мне немножко <a href="https://yoomoney.ru/fundraise/143H2JO3LLE.240720">доната</a>😊</div>
<iframe src="https://yoomoney.ru/quickpay/fundraise/button?billNumber=143H2JO3LLE.240720"
width="330" height="50" frameborder="0" allowtransparency="true" scrolling="no"></iframe>';

$string['error_txdatabase'] = 'Error write TX data to database';
6 changes: 3 additions & 3 deletions return.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@
$signature = optional_param('SignatureValue', null, PARAM_TEXT);

if (!$robokassatx = $DB->get_record('paygw_robokassa', ['paymentid' => $invid])) {
throw new Error('FAIL. Not a valid transaction id');
throw new \moodle_exception(get_string('error_notvalidtxid', 'paygw_robokassa'), 'paygw_robokassa');
}

if (!$payment = $DB->get_record('payments', ['id' => $robokassatx->paymentid])) {
throw new Error('FAIL. Not a valid payment.');
throw new \moodle_exception(get_string('error_notvalidpayment', 'paygw_robokassa'), 'paygw_robokassa');
}

$paymentarea = $payment->paymentarea;
Expand Down Expand Up @@ -77,7 +77,7 @@

// Check crc and redirect.
if ($signature != $crc) {
throw new Error('FAIL. Not a valid signature.');
throw new \moodle_exception(get_string('error_notvalidsignature', 'paygw_robokassa'), 'paygw_robokassa');
}

if ($robokassatx->success) {
Expand Down
6 changes: 3 additions & 3 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
defined('MOODLE_INTERNAL') || die();

if ($ADMIN->fulltree) {
$header = 'Новые версии плагина вы можете найти на
<a href=https://github.com/Snickser/moodle-paygw_robokassa>GitHub.com</a>';
$plugininfo = \core_plugin_manager::instance()->get_plugin_info('paygw_robokassa');
$donate = get_string('donate', 'paygw_robokassa', $plugininfo);

$settings->add(new admin_setting_heading(
'paygw_robokassa_settings',
$header,
$donate,
get_string('pluginname_desc', 'paygw_robokassa')
));
\core_payment\helper::add_common_gateway_settings($settings, 'paygw_robokassa');
Expand Down

0 comments on commit c6240e1

Please sign in to comment.