You are here

function payment_form_process_context in Payment 7

Implements form process callback for a payment_form_context element.

1 string reference to 'payment_form_process_context'
payment_element_info in ./payment.module
Implements hook_element_info().

File

./payment.ui.inc, line 648
The Payment user interface.

Code

function payment_form_process_context(array $element, array &$form_state, array $form) {
  if ($build_callback = payment_method_controller_form_callback(payment_method_controller_load($element['#payment_method_controller_name']), $element['#callback_type'], 'build')) {
    $element = array_merge($element, $build_callback($element, $form_state));
  }
  if ($validate_callback = payment_method_controller_form_callback(payment_method_controller_load($element['#payment_method_controller_name']), $element['#callback_type'], 'validate')) {
    $element['#element_validate'] = array(
      $validate_callback,
    );
  }
  return $element;
}