You are here

function _uc_authorizenet_login_data in Ubercart 5

Same name and namespace in other branches
  1. 6.2 payment/uc_authorizenet/uc_authorizenet.module \_uc_authorizenet_login_data()
  2. 7.3 payment/uc_authorizenet/uc_authorizenet.module \_uc_authorizenet_login_data()
2 calls to _uc_authorizenet_login_data()
uc_authorizenet_settings_form in payment/uc_authorizenet/uc_authorizenet.module
Callback for payment gateway settings.
uc_authorizenet_silent_post in payment/uc_authorizenet/uc_authorizenet.module

File

payment/uc_authorizenet/uc_authorizenet.module, line 1431
Process payments using Authorize.net. Supports AIM and ARB.

Code

function _uc_authorizenet_login_data() {
  static $data;
  if (!empty($data)) {
    return $data;
  }
  $md5_hash = variable_get('uc_authnet_md5_hash', '');

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

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

    // Decrypt the MD5 Hash.
    if (!empty($md5_hash)) {
      $md5_hash = $crypt
        ->decrypt($key, $md5_hash);
    }

    // Store any errors.
    uc_store_encryption_errors($crypt, 'uc_cybersource');
  }
  $data = array(
    'md5_hash' => $md5_hash,
  );
  return $data;
}