You are here

function pay_method::pay_method_validate in Pay 7

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

@todo Please document this function.

See also

http://drupal.org/node/1354

1 call to pay_method::pay_method_validate()
pay_method_gateway::pay_method_validate in includes/handlers/pay_method_gateway.inc
@todo Please document this function.
1 method overrides pay_method::pay_method_validate()
pay_method_gateway::pay_method_validate in includes/handlers/pay_method_gateway.inc
@todo Please document this function.

File

includes/handlers/pay_method.inc, line 166
The base class for payment activities. All payment method classes should extend this class.

Class

pay_method
@file The base class for payment activities. All payment method classes should extend this class.

Code

function pay_method_validate($form, &$form_state, $element) {

  // Confirm that the amount falls within our min/max settings.
  if ($this->total < $this->min_amount || $this->total > $this->max_amount) {
    $error = t('The %method payment method requires an amount between %min and %max', array(
      '%method' => $this
        ->title(),
      '%min' => $this->min_amount,
      '%max' => $this->max_amount,
    ));
    form_error($element['total'], $error);
  }
}