-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwebform_pagamentos.module
More file actions
31 lines (24 loc) · 1.1 KB
/
webform_pagamentos.module
File metadata and controls
31 lines (24 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\webform\WebformInterface;
use Drupal\webform\WebformSubmissionInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
function webform_pagamentos_webform_third_party_settings_form_alter(array &$form, FormStateInterface $form_state) {
$webform = $form_state->getFormObject()->getEntity();
$form['third_party_settings']['webform_pagamentos'] = [
'#type' => 'details',
'#title' => t('Universidade de São Paulo - Pagamentos'),
'#open' => FALSE,
];
$form['third_party_settings']['webform_pagamentos']['habilitar_boleto'] = [
'#type' => 'checkbox',
'#title' => t('Habilitar Boleto'),
'#default_value' => $webform->getThirdPartySetting('webform_pagamentos', 'habilitar_boleto', FALSE),
];
$form['third_party_settings']['webform_pagamentos']['habilitar_pix'] = [
'#type' => 'checkbox',
'#title' => t('Habilitar Pix'),
'#default_value' => $webform->getThirdPartySetting('webform_pagamentos', 'habilitar_pix', FALSE),
];
}