You are here

function PaymentMethod::validate in Payment 7

Validate a payment against this payment method.

Parameters

Payment $payment:

boolean $strict: Whether to validate everything a payment method needs or to validate the most important things only. Useful when finding available payment methods, for instance, which does not require unimportant things to be a 100% valid.

Throws

PaymentValidationException

File

./payment.classes.inc, line 593
The API and related functions for executing and managing payments.

Class

PaymentMethod
Payment method configuration.

Code

function validate(Payment $payment, $strict = TRUE) {
  $this->controller
    ->validate($payment, $this, $strict);
  module_invoke_all('payment_validate', $payment, $this, $strict);
  if (module_exists('rules')) {
    rules_invoke_event('payment_validate', $payment, $this, $strict);
  }
}