You are here

function commerce_payflow_link_submit_form_validate in Commerce PayPal 7.2

Payment method callback: submit form validation.

File

modules/payflow/commerce_payflow.module, line 533
Implements PayPal Payments Advanced (U.S. only) and Payflow Link Hosted Checkout pages and Transparent Redirect.

Code

function commerce_payflow_link_submit_form_validate($payment_method, $pane_form, $pane_values, $order, $form_parents = array()) {

  // Return an error if the enabling action's settings haven't been configured.
  foreach (array(
    'partner',
    'vendor',
    'user',
    'password',
  ) as $key) {
    if (empty($payment_method['settings'][$key])) {
      drupal_set_message(t('@title is not configured for use. Please contact an administrator to resolve this issue.', array(
        '@title' => $payment_method['title'],
      )), 'error');
      return FALSE;
    }
  }
  return TRUE;
}