You are here

function paymentmethodbasic_payment_method_configuration_form_elements in Payment 7

Form build callback: implements PaymentMethodController::payment_method_configuration_form_elements_callback.

Return value

array A Drupal form.

File

modules/paymentmethodbasic/paymentmethodbasic.module, line 133
Hook implementations and shared functions.

Code

function paymentmethodbasic_payment_method_configuration_form_elements(array $form, array &$form_state) {
  $controller_data = $form_state['payment_method']->controller_data;
  $elements['status'] = array(
    '#type' => 'select',
    '#title' => t('Final payment status'),
    '#description' => t('The status to give a payment after being processed by this payment method.'),
    '#default_value' => isset($controller_data['status']) ? $controller_data['status'] : PAYMENT_STATUS_SUCCESS,
    '#options' => payment_status_options(),
  );
  $elements['message'] = array(
    '#type' => 'text_format',
    '#title' => t('Payment form message'),
    '#default_value' => isset($controller_data['message']) ? $controller_data['message'] : '',
    '#format' => isset($controller_data['text_format']) ? $controller_data['text_format'] : filter_default_format(),
  );
  return $elements;
}