You are here

function payment_method_controller_form_callback in Payment 7

Call one of a payment method controller's form callbacks.

Parameters

PaymentMethodController $controller:

string $callback: Either "payment" or "payment_method".

string $operation: Either "build" or "validate".

Return value

string The callback function's name.

1 call to payment_method_controller_form_callback()
payment_form_process_context in ./payment.ui.inc
Implements form process callback for a payment_form_context element.

File

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

Code

function payment_method_controller_form_callback(PaymentMethodController $controller, $callback, $operation) {
  $property = $callback . '_configuration_form_elements_callback';
  switch ($operation) {
    case 'build':
      $function = $controller->{$property};
      break;
    case 'validate':
      $function = $controller->{$property} . '_validate';
      break;
  }
  return isset($function) && function_exists($function) ? $function : FALSE;
}