You are here

function commerce_authnet_cim_submit_form_submit in Commerce Authorize.Net 7

Imitates the checkout form submission callback for the AIM payment method.

2 calls to commerce_authnet_cim_submit_form_submit()
commerce_authnet_acceptjs_submit_form_submit in includes/commerce_authnet.acceptjs.inc
Payment method callback: checkout form submission.
commerce_authnet_aim_submit_form_submit in ./commerce_authnet.module
Payment method callback: checkout form submission.

File

./commerce_authnet.module, line 769
Implements Authorize.Net payment services for use in Drupal Commerce.

Code

function commerce_authnet_cim_submit_form_submit($payment_method, $pane_form, $pane_values, $order, $charge) {

  // First attempt to load the card on file.
  $card_data = commerce_cardonfile_load($pane_values['cardonfile']);

  // Fail now if it is no longer available or the card is inactive.
  if (empty($card_data) || $card_data->status == 0) {
    drupal_set_message(t('The requested card on file is no longer valid.'), 'error');
    return FALSE;
  }
  return commerce_authnet_cim_cardonfile_charge($payment_method, $card_data, $order, $charge);
}