You are here

function pay_form::settings_form in Pay 7

Same name and namespace in other branches
  1. 6 includes/handlers/pay_form.inc \pay_form::settings_form()

Overrides pay::settings_form

File

includes/handlers/pay_form.inc, line 151
The base class for payment activities. All payment form classes should extend this.

Class

pay_form
@file The base class for payment activities. All payment form classes should extend this.

Code

function settings_form(&$form, &$form_state) {
  parent::settings_form($form, $form_state);
  $group = $this
    ->handler();

  // If the parent form has not supplied a title, add one.
  if (!isset($form['title'])) {
    $form[$group]['title'] = array(
      '#type' => 'textfield',
      '#title' => t('Title'),
      '#default_value' => $this->title,
      '#required' => TRUE,
      '#description' => t('This title will appear as the title of the form page and in listings.'),
    );
  }
  $form[$group]['min_amount'] = array(
    '#type' => 'textfield',
    '#size' => 10,
    '#title' => t('Minimum amount'),
    '#description' => t('The minimum allowed payment on this form. If there are service fees or other costs associated with receiving payments, you will want this to set this amount higher than those costs.'),
    '#default_value' => $this->min_amount,
  );
  $form[$group]['max_amount'] = array(
    '#type' => 'textfield',
    '#size' => 10,
    '#title' => t('Maximum amount'),
    '#description' => t('The maximum allowed amount for this form. If your payment method has a limit, this setting should reflect it.'),
    '#default_value' => $this->max_amount,
  );
  $form[$group]['pay_methods'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Available payment methods'),
    '#description' => t('Payment methods available for this form.'),
    '#options' => $this
      ->pay_method_list(),
    '#default_value' => $this->pay_methods,
  );

  /**
  * @todo Disable this until it's ready for prime time.
  *
  $form[$group]['user_register'] = array(
  '#type' => 'radios',
  '#title' => t('Provide a user registration form'),
  '#description' => t('Allow users to register or login while making a payment.'),
  '#options' => array(
  'none' => t('No: Transactions will be recorded anonymously.'),
  'optional' => t('Optional: If users do not register or login, their transaction will be recorded anonymously.'),
  'required' => t('Required: Users must register or login and payments will be associated with their account.'),
  ),
  '#default_value' => $this->user_register,
  );
  */
}