Skip to content

Commit

Permalink
Merge pull request #51 from Snickser/dev
Browse files Browse the repository at this point in the history
add
  • Loading branch information
Snickser authored Jul 14, 2024
2 parents 9e1d024 + 11597ae commit 0d20f72
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion classes/gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public static function add_configuration_to_gateway_form(\core_payment\form\acco
$mform->addHelpButton('recurrent', 'recurrent', 'paygw_yookassa');

$mform->addElement('duration', 'recurrentperiod', get_string('recurrentperiod', 'paygw_yookassa'));
$mform->setType('recurrentperiod', PARAM_TEXT);
$mform->setType('recurrentperiod', PARAM_INT);
$mform->hideIf('recurrentperiod', 'recurrent', "neq", 1);

$options = [
Expand Down Expand Up @@ -257,5 +257,8 @@ public static function validate_gateway_form(
if (!$data->suggest && $data->recurrentcost == 'suggest' && $data->recurrent) {
$errors['suggest'] = get_string('suggesterror', 'paygw_yookassa');
}
if (!$data->recurrentperiod && $data->recurrent) {
$errors['recurrentperiod'] = get_string('recurrentperioderror', 'paygw_yookassa');
}
}
}
1 change: 1 addition & 0 deletions lang/en/paygw_yookassa.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
$string['recurrent'] = 'Enable recurring payments';
$string['recurrent_help'] = 'Enable recurring payments';
$string['recurrentperiod'] = 'Recurring payment frequency';
$string['recurrentperioderror'] = 'Specify the frequency. More than once a day - only for tests!';

$string['recurrentcost'] = 'Recurring payment cost';
$string['recurrentcost_help'] = 'Specify what price to charge when making a recurring payment:<br>
Expand Down
3 changes: 2 additions & 1 deletion lang/ru/paygw_yookassa.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,10 @@
$string['recurrent'] = 'Включить регулярные платежи';
$string['recurrent_help'] = 'Регулярные (рекуррентные) платежи исполняются по таймеру без участия студента, данные первого платежа сохраняются на стороне банка и используются повторно, с некоторой периодичностью.';
$string['recurrentperiod'] = 'Периодичность регулярного платежа';
$string['recurrentperioderror'] = 'Укажите периодичность. Чаще чем раз в день - только для тестов!';

$string['recurrentcost'] = 'Стоимость регулярного платежа';
$string['recurrentcost_help'] = 'Указыввае какую цену брать при проведении регулярного платежа:<br>
$string['recurrentcost_help'] = 'Указывает какую цену брать при проведении регулярного платежа:<br>
Уплаченная - та, что была указана пользователем при создании регулярного платежа.<br>
Стоимость элемента - та, которая указана в настройках платёжного модуля или курса.<br>
Рекумендуемая - берётся из настроек этого интерфейса.';
Expand Down

0 comments on commit 0d20f72

Please sign in to comment.