You are here

function commerce_paypal_ec_order_form_validate in Commerce PayPal 7.2

Validate handler: ensures PayPal Express Checkout has been configured.

1 string reference to 'commerce_paypal_ec_order_form_validate'
commerce_paypal_bml_order_form in modules/ec/commerce_paypal_ec.module
Displays a PayPal Credit button as a form that redirects to PayPal.

File

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

Code

function commerce_paypal_ec_order_form_validate($form, &$form_state) {

  // 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($form_state['payment_method']['settings'][$key])) {
      form_set_error('', t('PayPal Express Checkout is not configured for use. Please contact an administrator to resolve this issue.'));
    }
  }
}