You are here

function commerce_square_capture_form_validate in Commerce Square Connect 7

Validate handler: check the credit amount before attempting credit request.

File

includes/commerce_square.admin.inc, line 39
Provides admin menu callbacks for Commerce Square.

Code

function commerce_square_capture_form_validate($form, &$form_state) {
  $transaction = $form_state['transaction'];
  if (time() - $transaction->created > 86400 * 6) {
    drupal_set_message(t('This capture has passed its 6 day limit for issuing a capture.'), 'error');
    drupal_goto('admin/commerce/orders/' . $form_state['order']->order_id . '/payment');
  }
}