You are here

function uc_authorizenet_payment_gateway_settings_submit in Ubercart 7.3

Same name and namespace in other branches
  1. 5 payment/uc_authorizenet/uc_authorizenet.module \uc_authorizenet_payment_gateway_settings_submit()
  2. 6.2 payment/uc_authorizenet/uc_authorizenet.module \uc_authorizenet_payment_gateway_settings_submit()

Submit handler for payment gateway settings form to encrypt fields.

1 string reference to 'uc_authorizenet_payment_gateway_settings_submit'
uc_authorizenet_form_uc_payment_method_settings_form_alter in payment/uc_authorizenet/uc_authorizenet.module
Implements hook_form_FORM_ID_alter() for uc_payment_method_settings_form().

File

payment/uc_authorizenet/uc_authorizenet.module, line 178
Processes payments using Authorize.net. Supports AIM and ARB.

Code

function uc_authorizenet_payment_gateway_settings_submit($form, &$form_state) {

  // If CC encryption has been configured properly.
  if ($key = uc_credit_encryption_key()) {

    // Setup our encryption object.
    $crypt = new UbercartEncryption();

    // Encrypt the Login ID, Transaction key, and MD5 Hash.
    if (!empty($form_state['values']['uc_authnet_md5_hash'])) {
      variable_set('uc_authnet_md5_hash', $crypt
        ->encrypt($key, $form_state['values']['uc_authnet_md5_hash']));
    }

    // Store any errors.
    uc_store_encryption_errors($crypt, 'uc_authorizenet');
  }
}