You are here

function commerce_paypal_wpp_submit_form_validate in Commerce PayPal 7.2

Same name and namespace in other branches
  1. 7 modules/wpp/commerce_paypal_wpp.module \commerce_paypal_wpp_submit_form_validate()

Payment method callback: checkout form validation.

File

modules/wpp/commerce_paypal_wpp.module, line 216
Implements PayPal Website Payments Pro in Drupal Commerce checkout.

Code

function commerce_paypal_wpp_submit_form_validate($payment_method, $pane_form, $pane_values, $order, $form_parents = array()) {
  module_load_include('inc', 'commerce_payment', 'includes/commerce_payment.credit_card');

  // Validate the credit card fields.
  $settings = array(
    'form_parents' => array_merge($form_parents, array(
      'credit_card',
    )),
  );
  if (!commerce_payment_credit_card_validate($pane_values['credit_card'], $settings)) {
    return FALSE;
  }
}