You are here

function commerce_paypal_ec_submit_form_validate in Commerce PayPal 7.2

Payment method callback: submit form validation.

File

modules/ec/commerce_paypal_ec.module, line 662
Implements PayPal Express Checkout in Drupal Commerce checkout.

Code

function commerce_paypal_ec_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(
    'api_username',
    'api_password',
    'api_signature',
  ) as $key) {
    if (empty($payment_method['settings'][$key])) {
      drupal_set_message(t('PayPal Express Checkout is not configured for use. Please contact an administrator to resolve this issue.'), 'error');
      return FALSE;
    }
  }
  return TRUE;
}